applied Phone number vaidations in Neb1, Neb2, Neb arise forms
Specific Folder FTP Upload / ftp-deploy (push) Successful in 38s Details

This commit is contained in:
Farhan Pathan 2026-06-05 16:55:01 +05:30
parent 4fe210274a
commit 413f812494
3 changed files with 51 additions and 2 deletions

View File

@ -188,6 +188,22 @@
<script src="{{asset('assets/libs/sweetalert2/sweetalert2.min.js')}}"></script>
<script type="text/javascript">
jQuery(document).ready(function($){
// Phone No. of Staff - Numeric only, starts with 6-9, max 10 digits
$('#field-phone_no_of_staff').on('input', function () {
this.value = this.value.replace(/\D/g, '');
// First digit must be 6, 7, 8, or 9
if (this.value.length > 0 && !/^[6-9]/.test(this.value)) {
this.value = '';
return;
}
this.value = this.value.slice(0, 10);
});
$('#field-user_id').change(function(){
let hierarchy = $('option:selected', this).attr('hierarchy');
$('#field-hierarchy_id').val(hierarchy)

View File

@ -188,6 +188,22 @@
<script src="{{asset('assets/libs/sweetalert2/sweetalert2.min.js')}}"></script>
<script type="text/javascript">
jQuery(document).ready(function($){
// Phone No. of Staff - Numeric only, starts with 6-9, max 10 digits
$('#field-phone_no_of_staff').on('input', function () {
this.value = this.value.replace(/\D/g, '');
// First digit must be 6, 7, 8, or 9
if (this.value.length > 0 && !/^[6-9]/.test(this.value)) {
this.value = '';
return;
}
this.value = this.value.slice(0, 10);
});
$('#field-user_id').change(function(){
let hierarchy = $('option:selected', this).attr('hierarchy');
$('#field-hierarchy_id').val(hierarchy)

View File

@ -230,11 +230,28 @@
this.value = this.value.replace(/[^A-Za-z ]/g, '');
});
// Phone No. of Staff - Numeric only, max 10 digits
// Phone No. of Staff - Numeric only, starts with 6-9, max 10 digits
$('#field-phone_no_staff').on('input', function () {
this.value = this.value.replace(/\D/g, '').slice(0, 10);
this.value = this.value.replace(/\D/g, '');
// First digit must be 6, 7, 8, or 9
if (this.value.length > 0 && !/^[6-9]/.test(this.value)) {
this.value = '';
return;
}
this.value = this.value.slice(0, 10);
});
// Phone No. of Staff - Numeric only, max 10 digits
/*$('#field-phone_no_staff').on('input', function () {
this.value = this.value.replace(/\D/g, '').slice(0, 10);
});*/
const respuleFields = [
'#field-budecort_respule',
'#field-levolin_respule',