jQuery Toggle Fields plug-in: What is it and how does it work?
- By
- Andrew Nevins
We have recently released a jQuery plug-in named ‘jQuery Toggle Fields' that helps developers show and hide form fields. Take a look at this plug-in on our Github and Github demo pages.
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
- Flexibility
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.
Let's work together
We believe that creating groundbreaking experiences that make measurable differences in the way people live takes a special type of collaboration. Our team designs impactful experiences by leaning on the variety of capabilities and expertise within Nomensa to ensure our solution is bespoke to your needs. We believe collaboration is key, let’s work together.