Form elements added by AHAH don't work
Darren Oh - August 25, 2008 - 18:46
| Project: | Documentation |
| Component: | Outdated |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
I'm running into two problems with form elements added to by AHAH:
- Elements with the #ahah property don't work unless Javascript settings are already on the page. So new elements with the #ahah property don't work.
- A file upload element requires the form enctype attribute to be set to "multipart/form-data". Adding a new file upload element can set this attribute in the server's cached copy of the form, but it doesn't change the setting in the browser.
For my current project I hacked around the problem by adding AHAH settings for all possible form elements that might be added to the page and by adding the enctype attribute "multipart/form-data" even when the initial form contains no file elements. This seems like a bug in AHAH form processing.

#1
A missing documentation bug. AJAX with 6.x FormAPI needs to be updated. CCK's content_add_more_js() function provides a good example for how to deal with this issue.
#2
Changed the component to reflect the new component categorization. See http://drupal.org/node/301443
-nielsbom
#3
That page has been deprecated and a whole new section on using AJAX/AHAH has been written and updated.
#4
Automatically closed -- issue fixed for two weeks with no activity.