AHAH question

Events happening in the community are now at Drupal community events on www.drupal.org.
shawn.palmer's picture

Does anyone have any experience with creating looping ahah events? I can get the 1st set of actions working with out issue but I cannot get the newly created items to be ahah enabled it looks like a running issue with D6 but non of the fixes that I can find seam to work

Comments

You're not alone.

mradcliffe's picture

Are you trying to do it with a file element? This was really annoying and terrible to work around.

The Adding dynamic form elements using AHAH page was hard to parse through, but is useful for doing AHAH on form elements that are not file elements (argh, the hacking I had to do for audio module at GiveCamp!). I think the important thing is to not try to replace the entire form. I'm trying to remember a specific example because I did something recently, but I can't remember at the moment.

I also had issues with using the Form API and AHAH with my Processing.js module, but I realized I did not need to use it as I was just doing client-side javascript show/hide.

Is possible to add ahah in the user-login form?

geberele's picture

Is possible to add ahah in the user-login form?

not refresh the page & show the result in a pop-up

geberele's picture

I'd like to ad ahah in the login form, so to not refresh the page and show the result in a pop-up.
Do someone know how to do that?
Thanks

Geberele

A brief explanation...

mradcliffe's picture

Yes, this is possible.

You would hide the submit button, create a new button with an #ahah or #ajax property. Depending on Drupal version, how-to do Javascript through PHP is different. In Drupal 7, AJAX Forms in Drupal 7. You basically just return the the $form in your ajax callback, and back in your form callback provide a conditional to change the form on the fly.

Because the login form uses a validate callback to do the actual validation, the user will be logged in at that point since ajax callbacks go through a form submit/validate. You would also need to add a submit callback on that button to set something in $form_state to use in that conditional.

Central Ohio

Group categories

Topics

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: