...
Code Block |
---|
<div class="row-fluid"> <div class="span4"> <label class="checkbox"> <input id="show" type="checkbox" name="show" value="show"> Show? </label> </div> <div class="span4 showwhen-target-show showwhen-value-show"> <label class="checkbox"> <input type="checkbox" name="shown" value="shown" class="required-whenactive"> Hi </label> </div> </div> <div class="row-fluid"> <div class="span4"> <label class="checkbox"> <input id="disable" type="checkbox" name="disable" value="disable"> Disable? </label> </div> <div class="span4 disablewhen-target-disable disablewhen-value-disable"> <label class="checkbox"> <input type="checkbox" name="disabled" value="Hi!" class="required-whenactive"> Hi </label> </div> </div> |
Set Field Values on Form Submission
In this section "hidden (not visible)" means an input where type="hidden" or any field that is not visible at the time of submit (e.g., display:none).
Set a Hidden (not visible) Field to the Value of Another Field
Apply class "setonsubmit-ifhidden-FIELD_ID" where FIELD_ID is the ID (not the name) of the field you want to take the value from.
Clear the Value of a Hidden (not visible) Field
To clear the value on a field-by-field basis, apply the "setonsubmit-ifhidden_clear" class to each field. To apply it to all hidden fields in a given form use the "setonsubmit-clearhidden" field.
Disable a Hidden (not visible) Field
To disable a hidden field on submission, use the "setonsubmit-ifhidden_disable" class. There isn't much difference between this and clearing the value. Clearing the value will still submit the field as the key with no value. Disabling the field will not transmit it whatsoever.
Clear the Value of Any Field on a "Return" Action
Sometimes you may want to clear the value of a field when the form is being returned (e.g., the date and signature of an approval section). To do this on a field-by-field basis, apply the "setonsubmit-ifreturn_clear" class to each field. To clear all fields in a given section, apply "setonsubmit-ifreturn_clear" to the <form> itself.