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 form builder function is in charge of almost all logic.

Parent topics

File

modules/examples/ajax_example/ajax_example_graceful_degradation.inc, line 7
Demonstrations of AJAX with graceful degradation.

Functions

Namesort descending Location Description
ajax_example_add_more modules/examples/ajax_example/ajax_example_graceful_degradation.inc Form with 'add more' and 'remove' buttons.
ajax_example_add_more_add_one modules/examples/ajax_example/ajax_example_graceful_degradation.inc Submit handler for the "add-one-more" button.
ajax_example_add_more_callback modules/examples/ajax_example/ajax_example_graceful_degradation.inc Callback for both ajax-enabled buttons.
ajax_example_add_more_remove_one modules/examples/ajax_example/ajax_example_graceful_degradation.inc Submit handler for the "remove one" button.
ajax_example_add_more_submit modules/examples/ajax_example/ajax_example_graceful_degradation.inc Final submit handler.
ajax_example_dependent_dropdown_degrades modules/examples/ajax_example/ajax_example_graceful_degradation.inc Dropdown form based on previous choices.
ajax_example_dependent_dropdown_degrades_first_callback modules/examples/ajax_example/ajax_example_graceful_degradation.inc Selects just the second dropdown to be returned for re-rendering.
ajax_example_dependent_dropdown_degrades_submit modules/examples/ajax_example/ajax_example_graceful_degradation.inc Submit function for ajax_example_dependent_dropdown_degrades().
ajax_example_dynamic_sections modules/examples/ajax_example/ajax_example_graceful_degradation.inc Dynamically-enabled form with graceful no-JavaScript degradation.
ajax_example_dynamic_sections_select_callback modules/examples/ajax_example/ajax_example_graceful_degradation.inc Callback for the select element.
ajax_example_dynamic_sections_submit modules/examples/ajax_example/ajax_example_graceful_degradation.inc Submit function for ajax_example_dynamic_sections().
ajax_example_dynamic_sections_validate modules/examples/ajax_example/ajax_example_graceful_degradation.inc Validation function for ajax_example_dynamic_sections().
ajax_example_wizard modules/examples/ajax_example/ajax_example_graceful_degradation.inc Wizard form.
ajax_example_wizard_callback modules/examples/ajax_example/ajax_example_graceful_degradation.inc Wizard callback function.
ajax_example_wizard_submit modules/examples/ajax_example/ajax_example_graceful_degradation.inc Submit function for ajax_example_wizard.