From 2b7799f896252bd60093da2a7c0469f81e0f8b07 Mon Sep 17 00:00:00 2001 From: zeeshan Date: Thu, 20 Aug 2026 16:08:37 +0530 Subject: [PATCH] Iva (Poviztra Tracker Changes) --- ...8be4-f35b-47ad-8b48-7c64f517a09d.blade.php | 37 +++++++++++++++++++ ...31bf-03ef-4a05-aecc-5be58c7b0354.blade.php | 2 +- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/resources/views/form/rapport-iva/1778584267-4f728be4-f35b-47ad-8b48-7c64f517a09d.blade.php b/resources/views/form/rapport-iva/1778584267-4f728be4-f35b-47ad-8b48-7c64f517a09d.blade.php index b2b7790c..bdb1980a 100644 --- a/resources/views/form/rapport-iva/1778584267-4f728be4-f35b-47ad-8b48-7c64f517a09d.blade.php +++ b/resources/views/form/rapport-iva/1778584267-4f728be4-f35b-47ad-8b48-7c64f517a09d.blade.php @@ -262,16 +262,53 @@ this.value = this.value.slice(0, 10); } }); + + $('#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){ 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]); // Log form data to console for (let [key, value] of formData.entries()) { console.log(key, value); } $("#pageloader").fadeIn(); + + $.ajax({ type: "POST", url: '/form/ajaxsubmit', diff --git a/resources/views/form/rapport-iva/1778666440-156131bf-03ef-4a05-aecc-5be58c7b0354.blade.php b/resources/views/form/rapport-iva/1778666440-156131bf-03ef-4a05-aecc-5be58c7b0354.blade.php index 0bd119ef..95dde72d 100644 --- a/resources/views/form/rapport-iva/1778666440-156131bf-03ef-4a05-aecc-5be58c7b0354.blade.php +++ b/resources/views/form/rapport-iva/1778666440-156131bf-03ef-4a05-aecc-5be58c7b0354.blade.php @@ -293,7 +293,7 @@ }); - + $('#field-uid_number').attr('readonly',true); $('#report-form').on('submit', function(event){