diff --git a/resources/views/form/rapport-team4/1793785288-f76eca22-0891-4e77-88e8-56b43dd57c5e.blade.php b/resources/views/form/rapport-team4/1793785288-f76eca22-0891-4e77-88e8-56b43dd57c5e.blade.php index 6d1fff65..e1db4266 100644 --- a/resources/views/form/rapport-team4/1793785288-f76eca22-0891-4e77-88e8-56b43dd57c5e.blade.php +++ b/resources/views/form/rapport-team4/1793785288-f76eca22-0891-4e77-88e8-56b43dd57c5e.blade.php @@ -44,9 +44,9 @@ $submissions = Formhelper::getMultiformData( $form->partition, $form_id, $form->user_id); $submissions = $submissions->data->submissions; - echo "
";
+ /* echo "";
print_r($submissions);
- echo "";
+ echo ""; */
@endphp
@if(count($submissions) <=4)
@@ -268,6 +268,9 @@
$("[id^='field-contact_id']").each(function() {
var select = $(this);
// Clear previous options
+
+ var existingVal = select.val() || select.attr('data-preselected') || '';
+
select.html('');
// Add a default 'Select' option
select.append(
@@ -290,6 +293,10 @@
select.append(option);
});
+ if (existingVal) {
+ select.val(existingVal);
+ }
+
// For each select element, add a change event handler to populate `msl_code` and `speciality`
// We assume dropdowns and targets follow the pattern:
// - select: field-contact_id_1, field-contact_id_2, ..., field-contact_id
@@ -320,7 +327,11 @@
});
// Ensure unique selection is enforced after initial render
+ if(existingVal){
+ select.trigger('change');
+ }else{
enforceUniqueDoctorSelections();
+ }
});
// Enable search on doctor dropdowns