views:

31

answers:

1

i have a custom module, in which i am submitting the form using drupal submit. ie using mymodule_submit() function. i want to ajaxify this submit using jquery. what all are the prerequisites for ajaxifying in drupal ? how to return the values and all? somebody please help . thanks in advance

+1  A: 

Several high-level concepts are important:

  • do it trough forms api. technically you can circumvent it and write your own form-tags (in plain HTML) but that brings more problems then its worth.
  • changing the behaviour of any form, is done in a so called hook_form_alter()
  • Changing the look and feel of any form is done in the theme layer
  • Then you can add ajaxified behaviour to a theme using AHAH. Note that in Drupal AHAH is slightly misnamed: it is only a particular subset and works only for forms.
berkes
Not using the form API, and generating the HTML is considered a security issue.
kiamlaluno