Reputation: 97
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
Upvotes: 3
Views: 3462
Reputation: 97
http://drupal.org/project/examples
Upvotes: 0
Reputation: 544
There are 2 ways:
If you dont need to capture the submit response: Create a hidden iframe, and change the "target" attribute of the form to the iframe name. This can be done in 2 javascript lines, after form rendering.
If you need to capture response: Use Jquery form plugin, so after submit you need to give a callback function passing he response as argument.
Upvotes: 1
Reputation: 27573
Several high-level concepts are important:
Upvotes: 1