so I'm trying to create a simple checkbox that, once clicked, runs AHAH to see whether to enable or disable another part of the form.
I see 2 ways of doing this, either disable the field or just take it out altogether. then bring it back if the checkbox is clicked again.
My problem is, being new to using AHAH, I can't quite figure out how to check what the value of the checkbox is ( 1 or 0 ) and then, based on that value, return the appropriate output.
i read somewhere that there might be a 'params' key in the ahah array? how does it work? is there an AHAH documentation that I could take a look at? (aside from the FormAPI reference guide. http://api.drupal.org/api/file/developer/topics/forms_api_reference.html...)
Maybe I'm thinking a wee bit too hard on this but I can't seem to find a solution in the forums.
thanks,
Jng12
Comments
Ahah helper
Hi,
If you are adding elements to a form using ahah, the form building function has to cope up with those additions or Drupal will skip your added element or throw an error.
There is a useful module to do this easily.
check out http://drupal.org/project/ahah_helper
Hope this helps.
--------------------------------------------------------------
My attempt with Drupal - Jaanlo.com
doesn't pass arguments, but resubmits form
I came to this page with the same question, but it seems this is wrong question.
An AHAH callback is a complete form submission. You use a few standard lines of code to collect the post and rebuild the form fro the $_POST, and then return the new form element back to the page.
It's explained here and also in the example module:
http://drupal.org/node/331941