chriscook / form-toggler

Allows elements to be hidden or shown based on the value of a form component.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Form Toggler

Version 1.13

Introduction

Form Toggler is a jQuery plug-in which allows elements to be hidden or shown based on the value of a form component.

How to use it

  1. Add jquery.formToggler.js to your project, along with jQuery.
  2. Create your form. When you reach an element that you would like to be conditionally hidden, give it data-ft-name and data-ft-value attributes, where the first is the name of the element to check, and the second is the value that will cause the conditional element to be visible.
  3. Add the following jQuery to your page, to be executed on load:
	$('#form').formToggler();

...where #form is a selector for the <form> element.

A demo is available in demo.html.

Author and Acknowledgements

About

Allows elements to be hidden or shown based on the value of a form component.

License:MIT License


Languages

Language:JavaScript 100.0%