#self JS form validation
#self JS form validation
DOCTYPE html>
<html>
<body>
<h2>HTML Forms</h2>
<script>
Function validation ()
Var a=document.getElementbyID(“uname”).value;
Var b= document.getElementbyID(“email”).value;
Var c= document.getElementbyID(“psd”).value;
Var d= document.getElementbyID(“cpsd”).value;
return false;
return false;
else if(isNan(c))
Return false;
return false;
Else
true; }
</script>
<form onsubmit= “return validation ()” action= “page2.html”>// action will render the page
on click to the page2.html if you want to redirect on the same page then call function with
return otherwise without return
<label for="uname">username</label><br>
<label for="email”>E=mail</label><br>
<label for="password”>Password</label><br>
<label for="cpsd”>ConfirmPassword</label><br>
</form>
</body>
</html>