- examples
These examples show AJAX with graceful degradation when Javascript is not available.
In each of these the key idea is that the form is rebuilt different ways depending on form input. In order to accomplish that, the formbuilder function is in charge of almost all logic.
Functions & methods
| Name | Description |
|---|---|
| ajax_example_add_more | This example shows a button to "add more" - add another textfield, and the corresponding "remove" button. |
| ajax_example_add_more_add_one | Submit handler for the "add-one-more" button. |
| ajax_example_add_more_callback | Callback for both ajax-enabled buttons. |
| ajax_example_add_more_remove_one | Submit handler for the "remove one" button. |
| ajax_example_add_more_submit | Final submit handler. |
| ajax_example_dependent_dropdown_degrades | A form with a dropdown whose options are dependent on a choice made in a previous dropdown. |
| ajax_example_dependent_dropdown_degrades_first_callback | Selects just the second dropdown to be returned for re-rendering. |
| ajax_example_dependent_dropdown_degrades_submit | Submit function for ajax_example_dependent_dropdown_degrades(). |
| ajax_example_dynamic_sections | Example of a form with portions dynamically enabled or disabled, but with graceful degradation in the case of no javascript. |
| ajax_example_dynamic_sections_select_callback | Callback for the select element. |
| ajax_example_dynamic_sections_submit | Submit function for ajax_example_dynamic_sections(). |
| ajax_example_dynamic_sections_validate | Validation function for ajax_example_dynamic_sections(). |
| ajax_example_wizard | This example is a classic wizard, where a different and sequential form is presented on each step of the form. |
| ajax_example_wizard_callback | |
| ajax_example_wizard_submit | Submit function for ajax_example_wizard. |
File
- ajax_example/
ajax_example_graceful_degradation.inc, line 8 - Demonstrations of AJAX with graceful degradation.