-
+
@@ -1211,8 +1207,8 @@ if (!empty($EmpDetails)) {
+ The last character should be any number from 1 to 9.">
@@ -1698,17 +1693,16 @@ if (!empty($EmpDetails)) {
}
function ValidatePassport() {
- var regsaid = /^[A-Z][1-9]\d\s?\d{4}[1-9]$/ig;
- var passport = $("#passportno").val().trim();
+ var regsaid = /^[A-Z][1-9]\d\s?\d{4}[1-9]$/;
+
+ var passport = capitalizeFirstLetter($("#passportno").val().trim());
+
if (regsaid.test(passport) == false) {
alert('You have entered invalid Passport.');
- alert(` The first character must be an uppercase alphabet.
- The next two characters should be numbers,
- with the first character ranging from 1 to 9 and the second character from 0 to 9.
- It may include zero or one white space character.
- The subsequent four characters can be any number from 0 to 9.
- The last character should be any number from 1 to 9."`);
- return;
+ alert(`The first character must be an uppercase alphabet. The next two characters should be numbers,with the first character ranging from 1 to 9 and the second character from 0 to 9. It may include zero or one white space character. The subsequent four characters can be any number from 0 to 9. The last character should be any number from 1 to 9."`);
+ return (false);
+ } else {
+ return true;
}
}
@@ -2063,16 +2057,25 @@ if (!empty($EmpDetails)) {