-
-
+
+
Approve Claim Rejection
@@ -347,206 +348,299 @@
// }
// });
-
-
\ No newline at end of file
diff --git a/app/Views/ticket_form_gpa.php b/app/Views/ticket_form_gpa.php
index 42b916cb..9a546bd4 100644
--- a/app/Views/ticket_form_gpa.php
+++ b/app/Views/ticket_form_gpa.php
@@ -399,9 +399,10 @@ console.log('fields', fields);
console.log('$field id', $field);
let $parentDiv = $field.closest("div");
console.log('$parentDiv', $parentDiv);
-
+ // addRequiredFieldSymbol(targetId);
if ($parentDiv.length) {
let thirdClass = $parentDiv.attr("class").split(" ")[2] || "";
+ addRequiredFieldSymbolByClass(thirdClass);
console.log('thirdClass', thirdClass);
if (thirdClass) {
@@ -416,5 +417,61 @@ console.log('fields', fields);
}
}
});
+// function addRequiredFieldSymbol(field_name) {
+// // Find the field with the given name
+// var $field = $(`[name="${field_name}"]`);
+
+// if ($field.length) {
+// // Find the parent div of this field
+// var $parentDiv = $field.closest('div');
+
+// if ($parentDiv.length) {
+// // Get the classes as an array
+// var classes = $parentDiv.attr('class') ? $parentDiv.attr('class').split(/\s+/) : [];
+
+// if (classes.length > 0) {
+// // Get the last class in the array
+// var lastClass = classes[classes.length - 1];
+
+// // Find all divs with this last class
+// var $allDivsWithClass = $(`.${lastClass}`);
+
+// // Add asterisk to all labels within these divs
+// $allDivsWithClass.each(function() {
+// var $label = $(this).find('label');
+// if ($label.length && !$label.find('.text-danger').length) {
+// $label.append(' *');
+// }
+// });
+
+// console.log(`Added required symbol to ${$allDivsWithClass.length} labels with class "${lastClass}"`);
+// } else {
+// console.warn(`Parent div for field "${field_name}" has no classes`);
+// }
+// } else {
+// console.warn(`No parent div found for field name="${field_name}"`);
+// }
+// } else {
+// console.warn(`No field found with name="${field_name}"`);
+// }
+// }
+function addRequiredFieldSymbolByClass(className) {
+ // Find all divs with the specified class
+ var $divsWithClass = $(`.${className}`);
+
+ if ($divsWithClass.length) {
+ // Add asterisk to all labels within these divs
+ $divsWithClass.each(function() {
+ var $label = $(this).find('label');
+ if ($label.length && !$label.find('.text-danger').length) {
+ $label.append(' *');
+ }
+ });
+
+ console.log(`Added required symbol to ${$divsWithClass.length} labels with class "${className}"`);
+ } else {
+ console.warn(`No divs found with class="${className}"`);
+ }
+}
\ No newline at end of file