imperialized Posted February 12, 2009 Share Posted February 12, 2009 Ok, so I created a form that validates with ajax if an error is encountered, it will return a value. example: The original code is this: <tr> <td width=350> <b>Email Address:</b><br> <font size=2>*Email address MUST be valid in order to play.</font> </td> <td> <span id=\"email_chk\"> <input id=\"email\" name=\"email\" type=\"text\" class=\"reg_form\" maxlength=\"80\" onblur=\"check_email(this.form)\"> </span> </td> </tr> the returned code is this: print "<input id=\"email\" name=\"email\" type=\"text\" class=\"reg_form\" maxlength=\"80\" style=\"$failed\" value=\"$email\" onblur=\"check_email(this.form)\"> $x <br> <font size=1.5 color=red>Email does not match! ---> <input type=hidden name=\"email_error\" value=\"1\"> sets the error value to 1 When I call my javascript: var email_error=document.registration_form.email_error.value; if(email_error == 1){ alert('Check your email!'); return false; } The javascript doesn't catch anything or provide an alert... I dont know javascript for shit so I am lost Quote Link to comment Share on other sites More sharing options...
imperialized Posted February 12, 2009 Author Share Posted February 12, 2009 I guess this is solved, the problem was using the same form element name for both password and email fields, so javascript wasnt erroring but couldnt get the values. solved. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.