<script type= "Text/javascript" >functioncheckform (form) {if(Form.name. Value = = "") {alert ("The name cannot be empty!" "); return false; } if(Form.Password. value.length < 6| | Form.password.value.length > 13) {alert ("Password length should be between 6-13!" "); return false; } if(Form. Age. value<0| | form.age.value>120) {alert ("Please enter the correct age!" "); return false; } if(Form.Email. value.Match(/^\w+ (-\w+) | ( \.\w+)) *\@[a-za-z0-9]+ ((\.| -) [a-za-z0-9]+] *\. [a-za-z0-9]+$/] = =NULL) {alert ("Please enter the correct mailbox!" "); return false; } }</script>
Form form <form action= "regist.do" method= "POST" onsubmit= "return Checkform (This)" name= "form" >
In the input tag inside the name corresponding (name password age (int) email) can be such as: <input type= "text" class= "Inputgri" name= "email c2> "/>
JavaScript basic Form Validation