This widget is based on Spry's accordion. It integrates it with the TMT Validator. Form fields are validated one panel at time. Each time the user leaves a panel and moves to a new one, the previous is validated. Whenever the form is submitted instead, all fields are validate in one single swap
In order to use this library you need tmt_core.js, tmt_form.js and tmt_validator.js, for form validation, tmt_spryaccordionform.js for the accordion and SpryAccordion.js from Spry's accordion
The widget supports all the options supported by Spry's Accordion constructor options, plus an additional one:
| callback |
Optional. Specify the name of a custom JavaScript function that will handle error notification.
By default JavaScript alert boxes are used. You can also use the built-in tmt.validator.multiSectionBoxCallback (see sample). If a custom call back is specified, the widget will pass the following arguments to it:
|
Whenever a panel contains form validation errors, the "tmtAccordionError" class is applied to its label.
Whenever a panel passes validation, the "tmtAccordionValid" class is applied to its label
| validate() | Validate all the panels inside the accordion and invoke the callback. Return true if the form doesn't contain errors, false otherwise (see sample) |