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
Description

I'm running into two problems with form elements added to by AHAH:

  1. 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.
  2. 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

Darren Oh - August 26, 2008 - 15:58
Project:Drupal» Documentation
Version:6.x-dev» <none>
Component:forms system» Developer Guide

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

nielsbom - August 29, 2008 - 23:59
Component:Developer Guide» Outdated

Changed the component to reflect the new component categorization. See http://drupal.org/node/301443
-nielsbom

#3

add1sun - January 3, 2009 - 18:53
Status:active» fixed

That page has been deprecated and a whole new section on using AJAX/AHAH has been written and updated.

#4

System Message - January 17, 2009 - 19:00
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.