function validate_form ( )
{
valid = true;
if ( document.form.fname.value == "" )
{
alert ( "Please fill in the 'First Name'." );
valid = false;
}
if ( document.form.lname.value == "" )
{
alert ( "Please fill in the 'Last Name'." );
valid = false;
}
if ( document.form.branch.value == "" )
{
alert ( "Please fill in the 'Branch'." );
valid = false;
}
if ( document.form.aiit.value == 0 )
{
alert ( "Please fill in the 'Applied IIT'." );
valid = false;
}
if ( document.form.eid.value == "" )
{
alert ( "Please fill in the 'Email Id'." );
valid = false;
}
var x=document.form.eid.value;
var atpos=x.indexOf("@");
var dotpos=x.lastIndexOf(".");
if(atpos <1 || dotpos < atpos+2 ||dotpos+2>=x.length)
{
alert("Not a valid e-mail address");
valid=false;
}
var branch=document.form.branch.value;
if(branch.length>=4)
{
alert("please enter valid branch name.")
valid=false;
}
return valid;
}