try not recreating form element

This commit is contained in:
Nathan Coad
2018-05-02 14:20:10 +10:00
parent f1fa34d6bc
commit ef66bf4842

View File

@@ -58,7 +58,7 @@ function booking_variety_regn_form($node, &$form_state)
'#type' => 'select', '#type' => 'select',
'#title' => t('Variety Session: ' . $timeslot->booking_variety_time_descrip), '#title' => t('Variety Session: ' . $timeslot->booking_variety_time_descrip),
'#required' => TRUE, '#required' => TRUE,
'#default_value' => isset($form_state['values'][$fieldname]) ? $form_state['values'][$fieldname] : 0, '#default_value' => isset($form_state['values'][$fieldname]) ? $form_state['values'][$fieldname] : 'Paintball',
'#options' => _booking_get_variety_timeslot_options($timeslot->tid), '#options' => _booking_get_variety_timeslot_options($timeslot->tid),
'#prefix' => '<div id="booking_variety_session_' . $timeslot->tid . 'wrapper">', '#prefix' => '<div id="booking_variety_session_' . $timeslot->tid . 'wrapper">',
'#suffix' => '</div>', '#suffix' => '</div>',
@@ -138,7 +138,7 @@ function booking_variety_session_callback($form, &$form_state) {
); );
//re-create the form element for this timeslot //re-create the form element for this timeslot
/*
$form['variety-sessions'][$fieldname] = array( $form['variety-sessions'][$fieldname] = array(
'#type' => 'select', '#type' => 'select',
'#title' => t('Variety Session: ' . $timeslot->booking_variety_time_descrip), '#title' => t('Variety Session: ' . $timeslot->booking_variety_time_descrip),
@@ -148,7 +148,7 @@ function booking_variety_session_callback($form, &$form_state) {
'#suffix' => '</div>', '#suffix' => '</div>',
'#default_value' => 1, '#default_value' => 1,
); );
*/
//$form['variety-sessions'][$fieldname]['#options'] = $options; //$form['variety-sessions'][$fieldname]['#options'] = $options;
// Tell drupal to update the wrapper for this field // Tell drupal to update the wrapper for this field