return false } if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){ alert("Email ID should be in the form name@domain.com") return false } if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){ alert("Email ID should be in the form name@domain.com") return false } if (str.indexOf(at,(lat+1))!=-1){ alert("Email ID should be in the form name@domain.com") return false } if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){ alert("Email ID should be in the form name@domain.com") return false } if (str.indexOf(dot,(lat+2))==-1){ alert("Email ID should be in the form name@domain.com") return false } if (str.indexOf(" ")!=-1){ alert("Email ID should be in the form name@domain.com") return false } return true } function validate(){ if(document.frm.fname.value==""){ alert('Name is a required field'); document.frm.fname.focus(); return false; } if(document.frm.company.value==""){ alert('Company is a required field'); document.frm.company.focus(); return false; } if(document.frm.city.value==""){ alert('City is a required field'); document.frm.city.focus(); return false; } if(document.frm.phone.value==""){ alert('Telephone is a required field'); document.frm.phone.focus(); return false; } if(document.frm.email.value==""){ alert('Email Address is a required field'); document.frm.email.focus(); return false; } if (echeck(document.frm.email.value)==false) { document.frm.email.focus(); return false; } // Captcha Validation var img = document.getElementById("hiddenname").value; var code = document.getElementById("captcha").value; if(document.getElementById("captcha").value=="") { alert('Please enter your captcha!'); document.getElementById("captcha").focus(); return false; } else if(img != code) { alert('Invalid captcha code!'); document.getElementById("captcha").focus(); return false; }else { alert('Form Submiteed Successfully.'); } return true; } function MM_openBrWindow(theURL,winName,features) { //v2.0 window.open(theURL,winName,features); } //-->
|
|
|
|||||||||||||||||||