dstreet / dependsOn

a jQuery plugin for handling form field dependencies
http://dstreet.github.com/dependsOn
MIT License
106 stars 32 forks source link

Option to toggle the container of the input rather than ID & associated label #21

Closed jameswragg closed 9 years ago

jameswragg commented 9 years ago

Consider this markup:

<div class="field">
    <label for="keywords">Keywords</label>
    <input id="keywords" name="keywords" type="text">
    <p>Pro tip: blah blah blah</p>
</div>

Currently the protip would be left in limbo if hidden, it would be great to tell dependsOn to target the parent container of the target on show/hide operations.

dstreet commented 9 years ago

You could use the 'onEnable' and 'onDisable' callbacks to toggle the visibility of subject's parent container.

jameswragg commented 9 years ago

I'll take that! Cheers.