function sb_textclear(ob, txtmsg){ if(ob.value==txtmsg){ ob.value=""; } } function sb_textset(ob, txtmsg){ if(ob.value==""){ ob.value=txtmsg; } } 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 name=document.vform.f_name var lastname=document.vform.last_name var emailID=document.vform.email var street=document.vform.st_add var po_code=document.vform.po_code var city=document.vform.city var st_provin=document.vform.st_provin var telephone =document.vform.telephone var password =document.vform.pass var country =document.vform.country if ((name.value==null)||(name.value=="")){ alert("Please Enter your First Name") name.focus() return false } if ((lastname.value==null)||(lastname.value=="")){ alert("Please Enter your Last Name") lastname.focus() return false } if ((emailID.value==null)||(emailID.value=="")){ alert("Please Enter your Email ID") emailID.focus() return false } if (echeck(emailID.value)==false){ emailID.value="" emailID.focus() return false } if ((street.value==null)||(street.value=="")){ alert("Please Enter Street Name") street.focus() return false } if ((po_code.value==null)||(po_code.value=="")){ alert("Please Enter Post Code Name") po_code.focus() return false } if ((city.value==null)||(city.value=="")){ alert("Please Enter City Name") city.focus() return false } if ((st_provin.value==null)||(st_provin.value=="")){ alert("Please Enter State/Province Name") st_provin.focus() return false } if ((country.value==null)||(country.value=="")){ alert("Please Select Country") country.focus() return false } if ((telephone.value==null)||(telephone.value=="")){ alert("Please Enter your Telephone") telephone.focus() return false } if ((password.value==null)||(password.value=="")){ alert("Please Enter your Password") password.focus() return false } return true }