From eeef23512d60e0d4123f6706a10b233e912045e2 Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Tue, 14 Oct 2025 14:08:39 +0530 Subject: [PATCH] CHANGE_VEHICLE_NO_VALIDATION : RV --- .../policy_transaction_inception_form.php | 1946 +++++++++++------ 1 file changed, 1264 insertions(+), 682 deletions(-) diff --git a/app/Views/policy_transaction_inception_form.php b/app/Views/policy_transaction_inception_form.php index 4ccac05a..268d952b 100644 --- a/app/Views/policy_transaction_inception_form.php +++ b/app/Views/policy_transaction_inception_form.php @@ -1,162 +1,260 @@ + +
@@ -200,117 +298,116 @@
- -
- -
-
-
-
-
- - + + $value) { + echo ""; } - ?> - -
- + } + ?> +
-
- -
- - -
- -
- - -
- -
- - -
- - - -
- - -
+
-
+
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ + + +
+ + +
+
+
- +
-
- -
+
+ +
@@ -526,344 +623,340 @@
@@ -5616,6 +6160,8 @@ $(".individual_client").find("select, input, textarea").val("").prop("required", true); } + toggleRequiredWithAsterisk('#gst', false); + toggleRequiredWithAsterisk('#mobile', false); $("#client_form_row_div").on("input change", "input, select, textarea", function () { if ($("#client_type").val() === "") { @@ -5661,39 +6207,75 @@ toastr.warning(message, 'WARNING'); // $(input).val(''); isGSTValid = false; - $('#client_add_modal_submit_btn').prop('disabled', true); + $('#client_form_submit_btn').prop('disabled', true); + $('#vehicle_form_submit_btn_id_for_disable').prop('disabled', true); } else { isGSTValid = true; - $('#client_add_modal_submit_btn').prop('disabled', false); + $('#client_form_submit_btn').prop('disabled', false); + $('#vehicle_form_submit_btn_id_for_disable').prop('disabled', false); } }); - $('#hide_smbt_btn button').prop('disabled', false); + $('#hide_smbt_btn_button').prop('disabled', false); } $('#client_type').on('change', function() { let client_type = $(this).val(); + console.log( "client_type", client_type); if(client_type == 1){ $('.group_client').show(); $('.individual_client').hide(); $(".group_client").find("select, input, textarea").val("").prop("required", true); $(".individual_client").find("select, input, textarea").val("").prop("required", false); + toggleRequiredWithAsterisk('#gst', false); }else{ $('.group_client').hide(); $('.individual_client').show(); $(".group_client").find("select, input, textarea").val("").prop("required", false); $(".individual_client").find("select, input, textarea").val("").prop("required", true); + toggleRequiredWithAsterisk('#gst', false); } }); + function toggleRequiredWithAsterisk(inputSelector, makeRequired) { + + var $input = $(inputSelector); + var $label = $input.closest('.form-group').find('label'); + + console.log('Toggling required for:', inputSelector, 'Make required:', makeRequired); + + if(makeRequired) { + $input.attr('required', true); + console.log('Added required attribute'); + + // Add asterisk if not already present + if($label.find('span.text-danger').length === 0) { + $label.append(' *'); + console.log('Added * to label'); + } else { + console.log('* already exists in label'); + } + } else { + $input.removeAttr('required'); + console.log('Removed required attribute'); + + // Remove asterisk + $label.find('span.text-danger').remove(); + console.log('Removed * from label'); + } + + console.log('Current input attributes:', $input.prop('outerHTML')); + console.log('Current label html:', $label.html()); + } + $(document).on("input change", "input[name='total[]']", function () { let val = $(this).val(); console.log("✅ total[] changed:", val); }); - \ No newline at end of file +