[development] Form API: AHAH on fields pulled in via AHAH

Lee Rowlands contact at rowlandsgroup.com
Wed Sep 22 20:57:28 UTC 2010


Hi Brian
Have a look at how filefield does it:
http://api.drupalecommerce.org/api/function/filefield_js/6
The bit towards the end of the function that adds a script tag to the
response.
Lee
On Wed, 2010-09-22 at 16:29 -0400, Brian Vuyk wrote:

> On 10-09-22 03:56 PM, Brian Vuyk wrote:
> > Hi all.
> >
> > I am working on modifying a node form to allow a user to progressively 
> > select down through a taxonomy tree, and when they have a final term 
> > selected, update the advanced view arguments for a view-backed 
> > nodereference field.
> >
> > I am using AHAH, so that as the user selects a term, the next set of 
> > potential sub terms will show, in a somewhat similar fashion to how 
> > Taxonomy Select works.
> >
> > However, the new select form elements I pull in via AHAH also have 
> > ['#ahah'] attributes themselves. As far as I can tell, the AHAH code 
> > doesn't seem to trigger for elements that were themselves brought into 
> > the form via AHAH.
> >
> > According to http://drupal.org/node/337941, you can get an array from 
> > drupal_add_js(NULL, NULL, 'header'); which you can in turn pass on to 
> > drupal_json() in order to attach the AHAH behaviours to elements 
> > pulled in via AHAH. However, I have tried this with no results.
> >
> > I would appreciate it very much if someone could take a look, and 
> > hopefully tell me where I've gone wrong, or what I have to do to get 
> > AHAH to work on the elements I am pulling in. You can view a copy of 
> > the module as it current stands at http://drupalbin.com/16170.
> >
> > Thanks,
> >
> > Brian
> 
> Just a side note, it appears that you get a 404 from drupalbin if you 
> use the above URL. Try this instead:
> 
> http://drupalbin.com/16170?nocache=1
> 
> Thanks!
> 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20100923/2b713c77/attachment.html 


More information about the development mailing list