[development] AHAH with fieldsets not rebuilding correctly
lists at jeffhartman.com
Sat Feb 19 06:05:17 UTC 2011
I've got a couple forms that use AHAH functions to generate a drop down of states/provinces based on the user's selection in a country drop down menu.
I'm using a very similar method as is found here:
One form works fine with fields as $form['country'] and $form['state']. The other form uses fieldsets and those fields get renamed and lose their hierarchy after the form is rebuilt.
So for example, the following fields start out like:
But after the form is rebuilt with form_builder and drupal_render using:
$output = drupal_render($form['guest']['state']);
$output .= drupal_render($form['guest']['zipcode']);
// Render form output as JSON
print drupal_json(array('data' => $output, 'status' => true));
The rebuilt fields are logically placed outside of the fieldset and end up as:
Thoughts on what might cause that? Thanks for any direction. I've struggled with this for hours!
More information about the development