Team 4 (Montair LC Kid ABM Conversion) Duplicate Doctor

This commit is contained in:
zeeshan 2026-11-04 16:16:32 +05:30
parent bd10ea014c
commit ccd681a52f
1 changed files with 13 additions and 2 deletions

View File

@ -44,9 +44,9 @@
$submissions = Formhelper::getMultiformData( $form->partition, $form_id, $form->user_id);
$submissions = $submissions->data->submissions;
echo "<pre>";
/* echo "<pre>";
print_r($submissions);
echo "</pre>";
echo "</pre>"; */
@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