Show or hide a field based on radio selection.
This example can be rather useful if you wish not to bug a guest with filling unnecessary information. In this example, the guest will be prompted with an additional field if "Other" is selected. If this option will be selected the user will be required to fill the new field.
The functionality is achieved with a little Javascript, placed in the Form Layout area. Basically, two functions are used: one that controls when the field is displayed (displayField()), and one that controls the field validation (validateFields()). These functions are triggered when the form is first displayed, and from the Additional Attributes area of the raddio group field and submit button.




RSS

