+
diff --git a/application/views/addemployee.php b/application/views/addemployee.php index 81a6fbb5..661f4642 100644 --- a/application/views/addemployee.php +++ b/application/views/addemployee.php @@ -21,6 +21,20 @@ $(function(){ }); + function blockKeyPress(evt) +{ + var charCode = (evt.which) ? evt.which : evt.keyCode; + alert(charCode); + if(charCode == 8 || charCode == 46 ) + + { + return false; + } + else + { + return false; + } +} function isNumberKey(evt) { @@ -57,30 +71,30 @@ function Validate() if($("#FirstName").val().length < 1) { alert('Please Enter FirstName'); - return; + return false; } if($("#LastName").val().length < 1) { alert('Please Enter LastName'); - return; + return false; } if($("#FatherName").val().length < 1) { alert('Please Enter FatherName'); - return; + return false; } if($("#DateofBirth").val().length < 1) { alert('Please Enter Date of Birth'); - return; + return false; } if ( $('#ContactNumber').val().length < 1 ) { alert('Please Enter Contact Number'); - return; + return false; } else if(!getMobileValidation()) - { return;} + { return false; } @@ -88,69 +102,69 @@ function Validate() if($("#emailid").val().length < 1) { alert('Please Enter Email ID'); - return; + return false; } else if(!validateEmail()) { - return; + return false; } if($("option:selected", $("#gender")).val() == '-1') { alert('Please Select Gender'); - return; + return false; } if($("option:selected", $("#MartialStatus")).val() == "-1") { alert('Please Select Martial Status'); - return; + return false; } if($("option:selected", $("#bloodgroup")).val() == "-1") { alert('Please Select Blood group '); - return; + return false; } if($("#currentaddress").val().length < 1) { alert('Please Enter Current Address'); - return; + return false; } if($("#permanentaddress").val().length < 1) { alert('Please Enter Permanent Address'); - return; + return false; } if($("#emergencycontactname").val().length < 1) { alert('Please Enter Emergency Contact Name'); - return; + return false; } if($("#emergencycontactnumber").val().length < 1) { alert('Please Enter Emergency Contact Number'); - return; + return false; } else if(!getValidEmergencyNumber()) - { return;} + { return false;} if($("option:selected", $("#desigination")).val() == "-1") { alert('Please Select Desigination '); - return; + return false; } if($("option:selected", $("#departmentname")).val() == "-1") { alert('Please Select Department name'); - return; + return false; } if($("option:selected", $("#eduqualifaction")).val() == "-1") { alert('Please Select Qualification'); - return; + return false; } if($("#referrercontno").val().length > 0) @@ -227,7 +241,6 @@ function getAge() { var today = new Date(); var birthDate = new Date(dateString); - var age = today.getFullYear() - birthDate.getFullYear(); var m = today.getMonth() - birthDate.getMonth(); if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) { @@ -282,6 +295,7 @@ function ValidatePassport() } + + +