The dynamic selects are populated via radio button selection. The first choice works fine but the second throws 'An illegal choice has been detected...' error. It does not matter which, of the two, is selected first. The form will, eventually, have five dynamic selections. I've modified and condensed the relevant code, which I've included below (sorry to post 100 lines of code).
Can anyone tell me why I'm getting the error and how to cure it? Thanks in advance.
<?php
function _wauco_construction_get_components_dropdown($key = '') {
$options = array(
t('Face') => array( 'one' => t('Facestock1'), 'two' => t('Facestock2'), 'three' => t('Facestock3'), 'four' => t('Facestock4')),
t('Liner') => array( 'one' => t('Liner1'), 'two' => t('Liner2'), 'three' => t('Liner3'), 'four' => t('Liner4')),
t('Adhesive') => array( 'one' => t('Adhesive1'), 'two' => t('Adhesive2'), 'three' => t('Adhesive3'), 'four' => t('Adhesive4')),
);
if (isset($options[$key])) {
return $options[$key];
}
else {
return array();
}
}
function wauco_construction_dropdown_callback_one($form, $form_state) {
return $form['component_one']['select'];
$form_state['rebuild'] = TRUE;
}
function wauco_construction_dropdown_callback_two($form, $form_state) {
return $form['component_two']['select'];
$form_state['rebuild'] = TRUE;
}