displayOnValue: Change a Form's Layout Based on its Values
Revealing all the components of a form can be confusing when not all information applies to any given input. This example shows how a form can change it's layout based on the values that are entered.
Applied from the target element using "displayOnValue"
Try the different options in the first two rows of this form. The script will only show the fields related to the choice.
This way the user can be guided through a complex form without asking for irrelevant information.
Applied from the source element using "displayIfChecked"
The same functionality can also be applied in reverse using "displayIfChecked" instead.
Either way can be useful in particular situations.
Required Files
-
jQuery Addon Script: jquery.classbehaviours.displayonvalue.js
- Prerequisite Script: jquery.classbehaviours.js
- Extra Script: jquery.classbehaviours.zebratable.js
- Example Markup: displayOnValue.html
Comments on this Article