PROGRAM TO IMPLEMENT EMPLOYEE DATABASE WITH ALL VALIDATION

 dbvalidate.html


<html> 

<head> 

<script> 

function VALIDATE() { 

var name = document.forms["RegForm"]["Name"]; 

var email = document.forms["RegForm"]["EMail"]; 

var phone = document.forms["RegForm"]["Telephone"]; 

var what = document.forms["RegForm"]["DEPT"]; 

var password = document.forms["RegForm"]["Password"]; 

var address = document.forms["RegForm"]["Address"]; 

if (name.value == "") { 

window.alert("Please enter your name."); 

name.focus(); 

return false; 

if (address.value == "") { 

window.alert("Please enter your address."); 

address.focus(); 

return false; 

if (email.value == "") { 

window.alert( 

"Please enter a valid e-mail address."); 

email.focus(); 

return false; 

}

if (phone.value == "") { 

window.alert( 

"Please enter your telephone number."); 

phone.focus(); 

return false; 

if (password.value == "") { 

window.alert("Please enter your password"); 

password.focus(); 

return false; 

if (what.selectedIndex < 1) { 

alert("Please enter your DEPARTMENT."); 

what.focus(); 

return false; 

return true;

</script> 

 </head> 

<body> 

<h1 style="text-align: center;COLOR:GREEN;">REGISTRATION FORM</h1> 

<form name="RegForm" 

onsubmit="return VALIDATE()" method="post"> 

<p>Name: <input type="text" size="30" name="Name" /></p> 

<br /> 

<p>Address: <input type="text" size="30" name="Address" /> 

</p> 

<br /> 

<p>E-mail Address: <input type="text" size="30" name="EMail" /></p> 

<br /> 

<p>Password: <input type="password" size="30" name="Password" /></p> 

                       <br /> 

<p>Telephone: <input type="text"size="30" name="Telephone" /></p> 

                      <br /> 

<p> 

SELECT YOUR DEPARTMENT: 

<select type="text" value="" name="DEPART"> 

<option>sales</option> 

<option>manufacturing</option> 

<option>accounts</option> 

<option>purchase</option> 

<option>delivery</option> 

</select> 

</p> 

<br /> 

<br /> 

<p>Comments: <textarea cols="55"name="Comment"> </textarea></p> 

<p> 

<input STYLE="COLOR:BLUE;" type="submit" value="send" name="Submit" /> 

<input STYLE="COLOR:BLUE;" type="reset" value="Reset" name="Reset" /> 

</p> 

</form> 

</body> 

</html> 

OUTPUT:





No comments:

Post a Comment