问题描述:

good day i'm having a problem with my code it won't continue if fields met the if statements having a problem giving the data because i think the javascript catches the verification but won't continue on and gives me the Sorry, error occured this time sending your message. that's my catcher if any error happends when you upload .

here's my javascript code

http://pastebin.com/6QV3syxL

and here's my verification boxes

http://pastebin.com/31VNpbkk

. the verification process works but the part where the script give the information and the javascript catches it it fails and won't continue to give the data to the sql statement

网友答案:

In your validation code blocks you redefine your error variable.

if(!lname.match(/^[a-zA-Z]*$/))
{
     var error = true;
     $('#lname_error').fadeIn(500);
}
else
{
     $('#lname_error').fadeOut(500);
}

Try removing the var so the same variable is used througout the code and not new variables each time.

if(!lname.match(/^[a-zA-Z]*$/))
{
     error = true;
     $('#lname_error').fadeIn(500);
}
else
{
     $('#lname_error').fadeOut(500);
}

...

if(error == false){
     ...
}
相关阅读:
Top