Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This project is not covered by Drupal’s security advisory policy.
Do you need submit the default Drupal form dynamically via AJAX? You got it. AJAX Forms API provides simple API to handle forms with AJAX. You just need add one or two parameters in hook_form_alter and your form will be sent dynamically.
How to use
- Implement hook_form_alter() in your module.
- For certain form add following code, example:
function my_module_form_alter(&$form, &$form_state, $form_id) { if ($form_id == 'article_node_form') { // Make form as AJAX form. $form['#ajax_api'] = TRUE; // Message which will be displayed after successful submitting. $form['#ajax_api_success_message'] = t('AJAX API message.'); } }
- Enjoy. Your form will be automatically validated via AJAX, after successful submitting you will see defined message.
Supporting organizations:
Development, Support
Project information
- 2 sites report using this module
- Created by sanchiz on , updated
- This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.
Releases
7.x-1.0-rc1
released 20 July 2014
Works with Drupal: 7.x
Development version: 7.x-1.x-dev updated 20 Jul 2014 at 10:43 UTC