From 09a9657039e182831e39daa4a1fefb158a9d8c72 Mon Sep 17 00:00:00 2001 From: Farhan Pathan Date: Mon, 17 Aug 2026 16:28:57 +0530 Subject: [PATCH] Team4 New Form : MONTAIR LC KID 5 - CHEMIST & DR TAGGING added validation --- ...-f94add7e-0b47-4fae-8ce1-c3abceecd87b.blade.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/resources/views/form/rapport-team4/1786942589-f94add7e-0b47-4fae-8ce1-c3abceecd87b.blade.php b/resources/views/form/rapport-team4/1786942589-f94add7e-0b47-4fae-8ce1-c3abceecd87b.blade.php index 4507ddfc..6498c929 100644 --- a/resources/views/form/rapport-team4/1786942589-f94add7e-0b47-4fae-8ce1-c3abceecd87b.blade.php +++ b/resources/views/form/rapport-team4/1786942589-f94add7e-0b47-4fae-8ce1-c3abceecd87b.blade.php @@ -353,7 +353,9 @@ // ========================================== - // CHEMIST NUMBER - NUMERIC ONLY + // CHEMIST PHONE NUMBER VALIDATION + // Starts with 6-9 + // Maximum 10 digits // No negative, decimal or special characters // Works for initial + dynamically added wrappers // ========================================== @@ -361,7 +363,17 @@ 'input', 'input[id^="field-chemist_"][id*="_number"]', function () { + + // Allow digits only this.value = this.value.replace(/[^0-9]/g, ''); + + // Maximum 10 digits + this.value = this.value.substring(0, 10); + + // First digit must be 6-9 + if (this.value.length > 0 && !/^[6-9]/.test(this.value)) { + this.value = ''; + } } );