We have recently released a jQuery plug-in named ‘jQuery Toggle Fields' that helps developers show and hide form fields.
What does jQuery Toggle Fields do?
The jQuery Toggle Fields plug-in disables form fields until another field is selected. For instance, a form has the field 'Title' with the options of 'Mr', 'Mrs', 'Miss' and 'Other'. Selecting 'Other' then shows an 'Other title' field for additional user input.
Why use jQuery Toggle Fields?
The main benefits of using the jQuery Toggle Fields plug-in are:
- Save time
Form logic is already handled for the developer
The jQuery Toggle Fields plug-in does not assume HTML structure for easy integration
- Recyclable code
This plug-in can be re-used with little overhead for other projects
How jQuery Toggle Fields work
The jQuery Toggle Fields plug-in adds a hidden class or a disabled attribute to form fields. This gives control to the developer as to how the fields should be hidden. For instance the fields could be greyed out or they could be hidden entirely from view.
The jQuery Toggle Fields plug-in should make a developer’s life easier by handling tedious parts of form logic that would otherwise take a long time to write.