First, thanks to everyone who's been so helpful previously - great community and the help is appreciated. Some day, I'll be smart enough to give some back.
I have a form with radio buttons and a dependent dropdown (a la: Ajax Examples). Clicking a radio button triggers the correct options to populate the select. That works perfectly, on its own. I want the user to be able to add more sets (a la: Ajax Examples). That works very nicely, too, on its own.
The problem is when I try and combine them. Embedding them in the loop causes the selects to not update on initial click - however - when I click the 'Add More' button, the first select updates and correctly displays the second set. It's got to be something with the for index ($i) but I'll be hogtied if I can figger it. (On a side note, trying to echo($form_state['num_names'])
throws an Ajax error, leading me to believe it might not be working correctly).
I apologize in advance, but I'm posting about 120 lines of stripped-down code below. If anyone has any ideas that might make my head stop banging against the wall...
function ajax_add_more_callback($form, $form_state) {
return $form['components_fieldset'];
} // end function ajax_add_more_callback
function ajax_add_more_add_one($form, &$form_state) {
$form_state['num_names']++;
$form_state['rebuild'] = TRUE;