diff --git a/app/Views/ticket_form_gmc.php b/app/Views/ticket_form_gmc.php index 6e90c394..1815316b 100644 --- a/app/Views/ticket_form_gmc.php +++ b/app/Views/ticket_form_gmc.php @@ -569,6 +569,27 @@ $('#claim_status_id').on('change', function() { updateClaimStatusDisplay($(this).val()); // claimStatusFieldChanges() + const selectedVal = $(this).val(); + const elementId = $(this).attr('id'); + + console.log('Selected Value:', selectedVal); + console.log('Element ID:', elementId); + + if(selectedVal == 2 || selectedVal == 14){ + $field = $('#non_id_reason') + $field.prop('required', false); + }else if(selectedVal == 1){ + + if($('#tpa_no').val() != ""){ + $field = $('#non_id_reason') + $field.prop('required', false); + var $parentDiv = $field.closest("div"); + $parentDiv.find("label[for='non_id_reason'] .text-danger").remove(); + }else{ + $field = $('#non_id_reason') + $field.prop('required', true); + } + } }); function claimStatusFieldChanges(fields) {