I am using php mysql for user registration. I have added javascript validation to check if any field is blank or not. But the form validation is not working. the form is \[code\]<?phpinclude("header.php");include ("includes/mainmenu.php");?><!--Javasript Validation File Import --><script type="text/javascript" src="http://stackoverflow.com/questions/15855790/js/validation.js"></script><script type="text/javascript" src="http://stackoverflow.com/questions/15855790/js/formreg.js"></script><script type="text/javascript" language="JavaScript">function HidePart(d) { document.getElementById(d).style.display = "none"; }function ShowPart(d) { document.getElementById(d).style.display = "block"; }function CheckboxChecked(b,d){ if(b) { ShowPart(d); } else { HidePart(d); }}</script><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><!--<link rel="stylesheet" type="text/css" href="http://stackoverflow.com/questions/15855790/styles/styles.css" />--><link href="http://stackoverflow.com/questions/15855790/styles/form.css" rel="stylesheet" type="text/css"><link href="http://stackoverflow.com/questions/15855790/styles/structure.css" rel="stylesheet"><link href="http://stackoverflow.com/questions/15855790/styles/bootstrap.css" rel="stylesheet"></head><body onLoad="document.registration.userid.focus();"><br><div id="container" class="ltr"> <header id="header" class="info"><h2>User Registration</h2></header> <form action="insert.php" method="post" name="regForm" onSubmit="return valide()"> <ul> <li id="foli0" class="notranslate"> <label class="desc" id="title0" for="Field0">Name</label> <span><input id="fname" type="text" name="fname" class="field text1 fn" size="50"/></span><span>Please Enter Your full Name</span> </li> <li id="foli0" class="notranslate"> <label class="desc" id="title0" for="Field0">Username</label> <span><input id="Field0" type="text" name="usernamename" class="field text1 fn" size="50" /></span> </li> <li id="foli0" class="notranslate"> <label class="desc" id="title0" for="group">Educational Background</label></td> <span><select id="Field0" class="field text1 fn" name="background" size="0"> <option selected="0" value="">select your Background</option> <option value="http://stackoverflow.com/questions/15855790/Science">Science</option> <option value="http://stackoverflow.com/questions/15855790/Humanities">Humanities</option> <option value="http://stackoverflow.com/questions/15855790/Commerce">Commerce</option> </select></span><span>Enter your HSC Background</span> </li> <li id="foli0" class="notranslate"> <label class="desc" id="title0" for="Field0">Date of Birth</label> <span><input id="Field0" type="date" name="birth" class="field text1 fn" size="50"/></span><span>Enter your date of Birth</span> </li> <li id="foli0" class="notranslate"> <label class="desc" id="title0" for="Field0">Password</label> <span><input id="Field0" type="password" name="password" class="field text1 fn" size="50" /></span><span>Enter your password</span> </li> <li id="foli0" class="notranslate"> <label class="desc" id="title0" for="Field0">Password</label> <span><input id="Field0" type="password" name="conpassword" class="field text1 fn" size="50" /></span><span>Enter your password again</span> </li> <li id="foli0" class="notranslate"> <label class="desc" id="title0" for="Field0">Email</label> <span><input id="Field0" type="text" name="email" class="field text1 fn" size="50" /></span><span>Enter a valid email address</span> </li> <li class="buttons "> <div> <input id="submit" name="submit" class="btn" type="submit" value="http://stackoverflow.com/questions/15855790/Complete Registration"/></div> </li> </ul> </form> </div><?phpinclude("includes/footer.php");?>\[/code\]and the validation javascript code is\[code\]function valide(){var fname=document.forms["regForm"]["fname"].value;var username=document.forms["regForm"]["username"].value;var subject = document.forms["regForm"]["background"].value;var password=document.forms["regForm"]["password"].value;var conpassword=document.forms["regForm"]["conpassword"].value;var email=document.forms["regForm"]["email"].value;var atpos=email.indexOf("@");var dotpos=email.lastIndexOf(".");if (fname==null || fname=="" || fname.length<7) { alert("Please provide Your full name"); return false; }else if (username==null || username=="") { if(username.length<6) { alert("Username must contains atleast 6 charecters"); } else alert("Please provide a username"); return false; } else if(subject==null || subject == "") { alert("Enter Background"); return false; } else if (password==null || password=="") { if(password.length<8) { alert("Password must contain atleast 8 charecters"); } else alert("Please insert your password"); return false; } else if (conpassword != password) { alert("Confirm password doesn't match"); return false; }else if (email==null || email=="") { alert("Email must be filled out."); return false; }else if (atpos <1 || dotpos <atpos+2 || dotpos + 2 >= email.length) { alert("Not a valid e-mail address"); return false; }}\[/code\]Please help me.