gerardobort/mongorilla — pull request #13 by michael-may (2014-09-19 21:18:01+00:00)
Title: Conditional fields

## Dependent Fields

Dependent fields allow you to show or hide form elements based on a set of rules you define.
This can be because it allows you to surface or remove certain inputs as they are, or are not, needed for completion of your form.

Currently, simple (on/off) dependent fields are supported.

To use this feature you need to apply some attributes to the dependent field's schema.
The object is formatted like this:

"yourDependentField" : {
...
"depends" : {
"nameOfParentField" : {
"value" : "action"
}
}
}

The "value" key should match the value you want the parent to have in order to apply the "action" to the child form. "*" is supported as a wildcard to match any non-empty value.

The "action" value currently supports "show" and "hide".
Forms with the "show" action start off hidden.
Forms with the "hide" action start off visible.