jQuery Toggle Fields plug-in: What is it and how does it work?

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.

Screenshot showing drop-down list of titles - Mr, Mrs, Miss, Other - with text box for user to detail if 'Other' selected

Why use jQuery Toggle Fields?

The main benefits of using the jQuery Toggle Fields plug-in are:

  1. Save time
    Form logic is already handled for the developer
     
  2. Flexibility
    The jQuery Toggle Fields plug-in does not assume HTML structure for easy integration
     
  3. 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.

Find out more about Nomensa's Web Development services and get in touch to discuss how we can work with you.  

Add a comment

Fields marked with an asterisk (*) are mandatory.