This commit is contained in:
Nathan Coad
2018-05-02 13:15:39 +10:00
parent 29e71e658d
commit f8a9f76e20

View File

@@ -87,10 +87,17 @@ function booking_variety_session_callback($form, &$form_state) {
//for each entry in the variety timeslot table, create a new form select item //for each entry in the variety timeslot table, create a new form select item
foreach($result as $timeslot) { foreach($result as $timeslot) {
$fieldname = 'select-variety-' . $timeslot->tid;
//re-create the form element for this timeslot //re-create the form element for this timeslot
$form['variety-sessions']['select-variety-' . $timeslot->tid]['#options'] = _booking_get_variety_timeslot_options($timeslot->tid); $form['variety-sessions'][$fieldname] = array(
$commands[] = ajax_command_replace('#select-variety-' . $timeslot->tid, drupal_render($form['variety-sessions']['select-variety-' . $timeslot->tid])); '#options' => _booking_get_variety_timeslot_options($timeslot->tid),
'#default_value' => '--',
//isset($form_state['values'][$fieldname]) ? $form_state['values'][$fieldname] : '--',
);
$commands[] = ajax_command_replace('#' . $fieldname, drupal_render($form['variety-sessions'][$fieldname]));
} }