Compare commits
2 Commits
c6ffd0759f
...
891eb91ead
| Author | SHA1 | Date |
|---|---|---|
|
|
891eb91ead | |
|
|
ccd681a52f |
|
|
@ -44,9 +44,9 @@
|
||||||
$submissions = Formhelper::getMultiformData( $form->partition, $form_id, $form->user_id);
|
$submissions = Formhelper::getMultiformData( $form->partition, $form_id, $form->user_id);
|
||||||
$submissions = $submissions->data->submissions;
|
$submissions = $submissions->data->submissions;
|
||||||
|
|
||||||
echo "<pre>";
|
/* echo "<pre>";
|
||||||
print_r($submissions);
|
print_r($submissions);
|
||||||
echo "</pre>";
|
echo "</pre>"; */
|
||||||
|
|
||||||
@endphp
|
@endphp
|
||||||
@if(count($submissions) <=4)
|
@if(count($submissions) <=4)
|
||||||
|
|
@ -268,6 +268,9 @@
|
||||||
$("[id^='field-contact_id']").each(function() {
|
$("[id^='field-contact_id']").each(function() {
|
||||||
var select = $(this);
|
var select = $(this);
|
||||||
// Clear previous options
|
// Clear previous options
|
||||||
|
|
||||||
|
var existingVal = select.val() || select.attr('data-preselected') || '';
|
||||||
|
|
||||||
select.html('');
|
select.html('');
|
||||||
// Add a default 'Select' option
|
// Add a default 'Select' option
|
||||||
select.append(
|
select.append(
|
||||||
|
|
@ -290,6 +293,10 @@
|
||||||
select.append(option);
|
select.append(option);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (existingVal) {
|
||||||
|
select.val(existingVal);
|
||||||
|
}
|
||||||
|
|
||||||
// For each select element, add a change event handler to populate `msl_code` and `speciality`
|
// For each select element, add a change event handler to populate `msl_code` and `speciality`
|
||||||
// We assume dropdowns and targets follow the pattern:
|
// We assume dropdowns and targets follow the pattern:
|
||||||
// - select: field-contact_id_1, field-contact_id_2, ..., field-contact_id
|
// - select: field-contact_id_1, field-contact_id_2, ..., field-contact_id
|
||||||
|
|
@ -320,7 +327,11 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
// Ensure unique selection is enforced after initial render
|
// Ensure unique selection is enforced after initial render
|
||||||
|
if(existingVal){
|
||||||
|
select.trigger('change');
|
||||||
|
}else{
|
||||||
enforceUniqueDoctorSelections();
|
enforceUniqueDoctorSelections();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Enable search on doctor dropdowns
|
// Enable search on doctor dropdowns
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue