Well, I read a lot on the Web, still haven't found a solution for my problem: I need to check if the contents of the file are "nok" or empty ("") using the jquery get method. One of the things I tried (doesn't work of course, but clearly shows my idea):
$(document).ready(function(){
$("#submit").click(function(){
...
var captchacheck="";
$.get("/form.php", function(data){captchacheck=data;}));
if(captchacheck == "nok") hasError=true;
...
So, please tell me how to really store a string from data into a global variable (or other suitable structure) so that plain nok text can be used in if statements.
source
share