diff --git a/application/views/addemployee.php b/application/views/addemployee.php index b4df15e6..3d30df88 100644 --- a/application/views/addemployee.php +++ b/application/views/addemployee.php @@ -19,9 +19,6 @@ $(function(){ $('#permanentaddress').val($('#currentaddress').val()); }); }); - - - function isNumberKey(evt) { var charCode = (evt.which) ? evt.which : evt.keyCode; @@ -54,48 +51,7 @@ function validatePAN() { } function Validate() { - if($("#FirstName").val().length < 1) - { - alert('Please Enter FirstName'); - return; - } - if($("#LastName").val().length < 1) - { - alert('Please Enter LastName'); - return; - } - if($("#FatherName").val().length < 1) - { - alert('Please Enter FatherName'); - return; - } - if($("#DateofBirth").val().length < 1) - { - alert('Please Enter Date of Birth'); - return; - } - if ( $('#ContactNumber').val().length < 1 ) - { - alert('Please Enter Contact Number'); - return; - } - else if(!getMobileValidation()) - { return;} - - - - - if($("#emailid").val().length < 1) - { - alert('Please Enter Email ID'); - return; - } - else if(!validateEmail()) - { - return; - } - - + if($("option:selected", $("#gender")).val() == '-1') { alert('Please Select Gender'); @@ -113,30 +69,6 @@ function Validate() alert('Please Select Blood group '); return; } - if($("#currentaddress").val().length < 1) - { - alert('Please Enter Current Address'); - return; - } - if($("#permanentaddress").val().length < 1) - { - alert('Please Enter Permanent Address'); - return; - } - if($("#emergencycontactname").val().length < 1) - { - alert('Please Enter Emergency Contact Name'); - return; - } - if($("#emergencycontactnumber").val().length < 1) - { - alert('Please Enter Emergency Contact Number'); - return; - } - else if(!getValidEmergencyNumber()) - { return;} - - if($("option:selected", $("#desigination")).val() == "-1") { alert('Please Select Desigination '); @@ -152,18 +84,15 @@ function Validate() alert('Please Select Qualification'); return; } + if(!validateEmail()) + { + alert('Please Enter Valid Email Address'); + return ; + } + getMobileValidation(); + getValidEmergencyNumber(); + getValidReferNumber(); - if($("#referrercontno").val().length > 0) - { - getValidReferNumber(); - } - - if($("#passportno").val().length > 1) - { - ValidatePassport(); - - } - } function getMobileValidation() { var contactNumber = $('#ContactNumber').val().length; @@ -179,7 +108,7 @@ function getMobileValidation() { } function getValidEmergencyNumber() { var contactNumber = $('#emergencycontactnumber').val().length; - if(contactNumber < 10) + if(contactNumber > 0 && contactNumber < 10) { alert('Please Enter valid Emergency Contact Number'); return false; @@ -218,7 +147,11 @@ function validateEmail() { return true; } } - + else + { + alert('Please Enter Email Address'); + return (false); + } } function getAge() { @@ -269,19 +202,6 @@ function resetphoto() $("#photo").src(""); } -function ValidatePassport() -{ - var regsaid = /^[A-PR-WY][1-9]\d\s?\d{4}[1-9]$/ig; - var passport = $("#passportno").val(); - //alert(passport); - if(regsaid.test(passport) == false) - { - alert('You have entered invalid Passport.'); - return; - } - -} -