Team 4 (Mother Forum) Pincode,City validation
Specific Folder FTP Upload / ftp-deploy (push) Successful in 1m46s Details

This commit is contained in:
zeeshan 2026-10-10 12:16:46 +05:30
parent 195a9e9680
commit 001c72d68e
1 changed files with 94 additions and 42 deletions

View File

@ -383,6 +383,58 @@
} }
}); });
$("[id^='field-city_']").on('input keyup paste', function() {
this.value = this.value.replace(/[^a-zA-Z\s]/g, '');
});
$("[id^='field-city_']").on('keypress', function(e) {
var regex = new RegExp("^[a-zA-Z\\s]+$");
var str = String.fromCharCode(!e.charCode ? e.which : e.charCode);
if (!regex.test(str)) {
e.preventDefault();
return false;
}
});
$("[id^='field-pin_code_']").on('input keyup paste', function() {
var val = this.value;
val = val.replace(/\D/g, '');
val = val.replace(/^0+/, '');
if (val.length > 6) {
val = val.substring(0, 6);
}
this.value = val;
});
$("[id^='field-pin_code_']").on('keypress', function(e) {
var char = String.fromCharCode(e.which || e.keyCode);
if (!/^\d$/.test(char)) {
e.preventDefault();
return false;
}
if (this.value.length === 0 && char === '0') {
e.preventDefault();
return false;
}
});
$("#pageloader").fadeOut(); $("#pageloader").fadeOut();