Shows and hides designated form fields based on the current value of a single select element that you designate.
- Designate the control element with the 'data-conditional-select-control' attribute. It must be a select element.
- Mark each element you want shown or hidden by giving it the
'data-show-for=VALUE'
attribute, whereVALUE
matches the value of the option element inside the control selector. - Initialize the plugin on the control selector's parent: $('.my-conditional-fields').conditionalFields();
- Now any elements you've designated will only be visible when the corresponding select option is selected.