The documentation link provided in the module description does a good job of detailing how the jquery form plugin would be used on a standalone web page. However, I am having trouble understanding how this would be used in Drupal 5 (and more specifically, how it would interact with the Drupal Forms API).
My question is whether jquery_form_add can be used in conjunction with a form created with the Drupal Forms API in Drupal 5 (and if so, where the jquery_form_add() command goes in relation to the form, form_validate, and form_submit functions).
I believe that a very simple code snippet of a jquery_form_add() implementation within a custom Drupal module would go a long way to augment the existing documentation defining how to use the jquery form plugin in a standalone web page. (Yes, I understand that building this sort of dependency into a custom module isn't the ideal, but it's being built as a module so that I can easily move it between development environments as opposed to for public release.)
Incidently, I have attempted to use the jquery_form_add() command in a standalone html form within a Drupal page, and have the AJAX submit portion working ... but after the submit routine completes, I am being re-directed to a blank page. So if the jquery_form_add() call can not be used in conjunction with the Forms_API, I'll try and post some of my half-working code for troubleshooting.
Thanks in advance,
- Jeremy
Comments
Comment #1
wim leersIt does *not* integrate with the Forms API. The *only* thing it does, is adding the .js file to the current page.
In Drupal 6, the jQuery Form plugin is included in Drupal core, and it's also tightly integrated with the Forms API.
For an example implementation, you can give a look at the Views Saved Searches module: JS file and .module file.
In the .module file, see
views_savedsearches_save_search_form(),_views_savedsearches_configure_ahah()andviews_savedsearches_ahah(). As you can see, you have to apply several work-arounds.I'm not planning extensive documentation, as Drupal 6 will simplify your life *a lot*. AHAH forms in Drupal 5 are *always* a hack!
If possible, I'd suggest you move on to Drupal 6.
Comment #2
jthorson commentedI was starting to suspect that ... Thanks for the update.
Comment #3
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.