<html>
<head>
<h2> Practical 7 : Create a web page to implement form events.
(Part-I)</h2>
<h3> Student Enrollment Form!</h3>
<style>
.bordered
{
width :500px;
Height: 450px;
border: 1px solid grey;
}
form
{
margin:6px;
}
</style>
</head>
<Body >
<div class="bordered">
<form name="new" method="post" action="#" ><br>
<label for ="code">All the fields marked with ' * ' are
compulsary.</label></br></br>
Course Code:*
<input type="text" id="Code" value=" 00CO24" disabled
></br></br>
Roll Number:*
<input type="text" id="rnum" required></br></br>
Student Name:*
<input type="text" id="sname" required></br></br>
Email:*
<input type="email" id="eid" required></br></br>
Password:*
<input type="password" id="pwd1" required></br></br>
Confirm Password:*
<input type="password" id="pwd2" required></br></br>
Gender:*
<input type="radio" name="radio1" value="Male" checked>Male
<tb>
<input type="radio" name="radio1" value="female"> Female
</br></br>
Language:*
<input type="checkbox" name="checkbox1" value="English"
checked>English<tb>
<input type="checkbox" name="checkbox1"
value="Hindi">Hindi<tb>
<input type="checkbox" name="checkbox1"
value="Marathi">Marathi<tb></br></br>
<input type="checkbox" name="checkbox2"> All the above
information is correct.<tb></br></br>
<input type="submit" name="submit" value="Submit"
onclick="Validate()"> <tb>
<input type="reset" name="reset" value="Reset"></br></br>
</div>
<script>
function Validate()
{
var rno=[Link]("rnum").value;
a=parseInt(rno)
var myname=[Link];
var Mail=[Link]("eid").value;
var pass1=[Link]("pwd1").value;
var pass2=[Link]("pwd2").value;
if(a <1 || a >52)
{
alert("Please enter roll number between 1 to 51");
}
if(isNaN(a))
{
alert("Please enter Numbers Only");
}
if([Link]<6)
{
alert("Password must be more than 6 characters.");
}
if( pass1== pass2)
{
[Link]("Roll Number : " +a + "<br>");
[Link]("Name : " +myname+ "<br>");
[Link]("Email : " +Mail+ "<br>");
[Link]("Password : " +pass1+ "<br>");
alert("Registration Completed!!");
return true;
}
else
{
alert("Password and Confirm Password Not Match.");
}
}
</script>
</form>
</Body>
</html>