function echeck(str) { var at="@" var dot="." var lat=str.indexOf(at) var lstr=str.length var ldot=str.indexOf(dot) if (str.indexOf(at)==-1){ alert("Invalid E-mail ID") return false } if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){ alert("Invalid E-mail ID") return false } if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){ alert("Invalid E-mail ID") return false } if (str.indexOf(at,(lat+1))!=-1){ alert("Invalid E-mail ID") return false } if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){ alert("Invalid E-mail ID") return false } if (str.indexOf(dot,(lat+2))==-1){ alert("Invalid E-mail ID") return false } if (str.indexOf(" ")!=-1){ alert("Invalid E-mail ID") return false } return true } function ValidateForm(){ var emailID=document.frm.email var fname=document.frm.fname var lname=document.frm.lname var city=document.frm.city var state=document.frm.state var user=document.frm.user var pass=document.frm.pass var cpass=document.frm.cpass var degree=document.frm.degree var major=document.frm.major var certificate=document.frm.certificate var exp=document.frm.exp if((user.value==null)||(user.value=="")) { alert("Enter User Name"); user.focus(); return false; } if((pass.value==null)||(pass.value=="")) { alert("Enter Password"); pass.focus(); return false; } if(cpass.value!=pass.value) { alert("Re-Type Password should be same as Password"); cpass.focus(); return false; } if((fname.value==null)||(fname.value=="")) { alert("Enter First Name"); fname.focus(); return false; } if((lname.value==null)||(lname.value=="")) { alert("Enter Last Name"); lname.focus(); return false; } if ((emailID.value==null)||(emailID.value=="")){ alert("Enter Email ID"); emailID.focus(); return false; } if (echeck(emailID.value)==false){ emailID.focus(); return false; } if((city.value==null)||(city.value=="")) { alert("Enter city"); city.focus(); return false; } if((state.value==null)||(state.value=="")) { alert("Enter state"); state.focus(); return false; } if((degree.value==null)||(degree.value=="")) { alert("Enter Most Advanced Degree"); degree.focus(); return false; } if((major.value==null)||(major.value=="")) { alert("Enter Major/Branch"); major.focus(); return false; } if((certificate.value==null)||(certificate.value=="")) { alert("Enter Certifications/Awards"); certificate.focus(); return false; } if((exp.value==null)||(exp.value=="")) { alert("Enter Experience"); exp.focus(); return false; } if(!document.frm.terms.checked) { alert("You have to accept the Terms of Service"); return false; } if(!document.frm.expertterms.checked) { alert("You have to accept the Expert Agreement"); return false; } return true } function Validateuser(){ var emailID=document.frm.user var user=document.frm.reguser var pass=document.frm.password /* if((name.value==null)||(name.value=="")) { alert("Enter Name"); name.focus(); return false; } */ if((user.value==null)||(user.value=="")) { alert("Enter User Name"); user.focus(); return false; } if((pass.value==null)||(pass.value=="")) { alert("Enter Password"); pass.focus(); return false; } /* if(cpass.value!=pass.value) { alert("Re-Type Password should be same as Password"); cpass.focus(); return false; } */ if ((emailID.value==null)||(emailID.value=="")){ alert("Enter Email ID"); emailID.focus(); return false; } if (echeck(emailID.value)==false){ emailID.focus(); return false; } /* if(!document.frm.terms.checked) { alert("You have to accept the Terms of Service"); return false; } */ return true } function Validatelogin(){ var emailID=document.frm.user var pass=document.frm.pass if ((emailID.value==null)||(emailID.value=="")){ alert("Enter Email ID"); emailID.focus(); return false; } if((pass.value==null)||(pass.value=="")) { alert("Enter Password"); pass.focus(); return false; } return true }