Iva (Poviztra Tracker Changes)
This commit is contained in:
parent
a4b9efabf3
commit
2b7799f896
|
|
@ -263,15 +263,52 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#field-customer_number').on('input', function () {
|
||||||
|
let value = $(this).val();
|
||||||
|
|
||||||
|
// फक्त numbers
|
||||||
|
value = value.replace(/\D/g, '');
|
||||||
|
|
||||||
|
// Maximum 10 digits
|
||||||
|
value = value.substring(0, 10);
|
||||||
|
|
||||||
|
$(this).val(value);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#field-customer_number').on('blur', function () {
|
||||||
|
let value = $(this).val();
|
||||||
|
|
||||||
|
if (!/^[6-9][0-9]{9}$/.test(value)) {
|
||||||
|
$(this).addClass('is-invalid');
|
||||||
|
} else {
|
||||||
|
$(this).removeClass('is-invalid');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
$('#report-form').on('submit', function(event){
|
$('#report-form').on('submit', function(event){
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
let value = $('#field-customer_number').val().trim();
|
||||||
|
|
||||||
|
if (!/^[6-9][0-9]{9}$/.test(value)) {
|
||||||
|
|
||||||
|
alert('Customer No must be exactly 10 digits and start with 6, 7, 8, or 9.');
|
||||||
|
|
||||||
|
$('#field-customer_number')
|
||||||
|
.val('')
|
||||||
|
.focus();
|
||||||
|
|
||||||
|
return false; // Submit थांबवतो
|
||||||
|
}
|
||||||
|
|
||||||
const formData = new FormData($('#report-form')[0]);
|
const formData = new FormData($('#report-form')[0]);
|
||||||
// Log form data to console
|
// Log form data to console
|
||||||
for (let [key, value] of formData.entries()) {
|
for (let [key, value] of formData.entries()) {
|
||||||
console.log(key, value);
|
console.log(key, value);
|
||||||
}
|
}
|
||||||
$("#pageloader").fadeIn();
|
$("#pageloader").fadeIn();
|
||||||
|
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: '/form/ajaxsubmit',
|
url: '/form/ajaxsubmit',
|
||||||
|
|
|
||||||
|
|
@ -293,7 +293,7 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$('#field-uid_number').attr('readonly',true);
|
||||||
|
|
||||||
|
|
||||||
$('#report-form').on('submit', function(event){
|
$('#report-form').on('submit', function(event){
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue