function doPost() { var appl_no = document.getElementById('appl_no').value; var mob_no = document.getElementById('mob_no').value; // var email_id=document.getElementById('email_id').value; /* * var pan = document.getElementById('pan_no').value; alert(pan); */ var txtPassword = document.getElementById('txtPassword').value; var txtpass2 = document.getElementById('pass2').value; if (appl_no == "" || appl_no == "null") { alert("Please Enter Application Number"); return false; } else if (mob_no == "" || mob_no == "null") { alert("Please Enter Mobile Number"); return false; } // else if(email_id=="" || email_id=="null" || // !validateEmailaddressAnnex(email_id)) // { // alert("Please Enter Valid Email Id"); // return false; // } /* * else if (pan == "" || pan == "null" || !validatePanAnnex(pan)) { * alert("Please Enter Valid PAN"); * * return false; } */else if (txtPassword == "" || txtPassword == "null" || !isValidpass(txtPassword)) { alert("Please Enter Valid Password"); return false; } else if (txtPassword != txtpass2) { alert("password and confirm password does not match"); return false; } else { encryptPassword(); return true; } } function encryptPassword() { } function validateEmailaddressAnnex(email) { // alert("in ValidateEmailaddress"); var mailformat = /^([a-zA-Z0-9._%+-])+\@([a-zA-Z0-9._%+-])+\.([a-zA-Z]{2,3})$/; ; if (email.length != 0) { if (!email.match(mailformat)) { alert("You have entered an invalid email address!"); // document.forms["page"]["emailadd"].focus(); // document.getElementById('email').value=""; // document.getElementById('email').focus(); return false; } else { // document.forms["page"]["emailadd"].focus(); return true; } } else { // alert("Please enter Email address!"); // document.forms["page"]["emailadd"].focus(); return false; } } function isValidpass(s) { // check for null or too short var pass = /.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/; if (!s || s.length < 8) { alert("Password should atleast 8 chracters"); return false; } else if (!s.match(pass)) { // document.forms["page"]["emailadd"].focus(); alert("Password format missmatch"); return false; } else { return true; } } function isValidmobno(mob) { var mob_no = /^[0-9]+$/; if (!mob.match(mob_no)) { alert("Mobile Number should be numeric"); return false; } else if (!mob || mob.length != 10) { alert("Mobile number should be 10 digit"); return false; } else { return true; } } function checkPasswordMatch() { var txtPassword = document.getElementById('txtPassword').value; var txtpass2 = document.getElementById('pass2').value; if (txtPassword != txtpass2) { $("#msg").append("password and confirm password is not match"); return false; } else { $("#msg").empty(); return true; } } function validatePanAnnex(pan) { return true; // alert("in ValidateEmailaddress"); // var exp = /^([a-z A-Z]{5,5})+([0-9]{4,4})+([a-z A-Z]{1,1})$/; // if (pan.length != 0) { // if (!pan.match(exp)) { // alert("You have entered an invalid PAN!"); // // document.forms["page"]["emailadd"].focus(); // // document.getElementById('email').value=""; // // document.getElementById('email').focus(); // return false; // // } else { // // document.forms["page"]["emailadd"].focus(); // return true; // } // } else { // // alert("Please enter Email address!"); // // document.forms["page"]["emailadd"].focus(); // return false; // } }