Hoibiabah4
New Member
i got error, For example i am having 4 text boxs name,dob,age and mail-id. in this if i entered name,dob and age but i am not entering mail-id. if i click submit the alert box appear in that mail id is empty like that. If i click ok in that alert box rest of the three field name,dob,age also got empty if i click ok. \[code\] <script> function validateForm(){var x=document.forms["registration_form"]["user_name"].value if (x==null || x=="") { alert("Please Enter The Name");return false;}else{ true}var x=document.forms["registration_form"]["dob"].valueif (x==null || x=="") { alert("Please Enter Date Of Birth"); return false;} else{ true}var x=document.forms["registration_form"]["age"].valueif (x==null || x=="") { alert("Please Enter Age");return false;}else{ true}var x=document.forms["registration_form"]["number"].valueif (x==null || x=="") { alert("Please Enter The Mobile Number");return false;}else{ true} var x=document.forms["registration_form"]["mail"].valuevar atpos=x.indexOf("@");var dotpos=x.lastIndexOf("."); if (x==null || x=="" || atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length) { alert("Please Enter a Valid Mail-Id and Must fill it"); return false; } else{ true} var x=document.forms["registration_form"]["address"].value if (x==null || x=="") { alert("Please Enter The address "); return false; }else{return true;}} </script>\[/code\]