var skipvalidation = false; function validateform(subformid) { subformid = subformid || ''; if(skipvalidation){ skipvalidation=false; return true; } varobj = document.getElementById('employeename'); if(varobj){ if(varobj.value==''){ if('yes' == 'yes'){ showalert('Invalid Input','[Name] cannot be empty'); varobj.focus(); return false; } } if(0>0){ if(varobj.value!='' && varobj.value.length < 0) { showalert('Invalid Input','[Name] length cannot be less than 0.'); return false; } } } varobj = document.getElementById('employeeemail'); if(varobj){ if(varobj.value==''){ if('yes' == 'yes'){ showalert('Invalid Input','[Email] cannot be empty'); varobj.focus(); return false; } } if(0>0){ if(varobj.value!='' && varobj.value.length < 0) { showalert('Invalid Input','[Email] length cannot be less than 0.'); return false; } } if(!validateemail(varobj)){ showalert('Invalid Input','[Email] is not a valid email address'); varobj.focus(); return false; } } varobj = document.getElementById('employeemobileno'); if(varobj){ if(varobj.value==''){ if('yes' == 'yes'){ showalert('Invalid Input','[Mobile No] cannot be empty'); varobj.focus(); return false; } } if(0>0){ if(varobj.value!='' && varobj.value.length < 0) { showalert('Invalid Input','[Mobile No] length cannot be less than 0.'); return false; } } } varobj = document.getElementById('employeeusername'); if(varobj){ if(varobj.value==''){ if('yes' == 'yes'){ showalert('Invalid Input','[User Name] cannot be empty'); varobj.focus(); return false; } } if(0>0){ if(varobj.value!='' && varobj.value.length < 0) { showalert('Invalid Input','[User Name] length cannot be less than 0.'); return false; } } } varobj = document.getElementById('employeepassword'); if(varobj){ if(varobj.value==''){ if('yes' == 'yes'){ showalert('Invalid Input','[PAssword] cannot be empty'); varobj.focus(); return false; } } if(0>0){ if(varobj.value!='' && varobj.value.length < 0) { showalert('Invalid Input','[PAssword] length cannot be less than 0.'); return false; } } } return true; } function validateemail(varobj) { if(varobj) { var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; if(!filter.test(varobj.value)) { return false; } } return true; } function validateradio(varobj) { radvarobj = document.getElementsByName(varobj.name); for(var i=0; i