Conditionals schema examples
These schema examples demonstrate the use of conditionals.
Conditionals: example oneLink copied!
This example demonstrates the use of conditionals to:
-
Set the validation of the
addressCodeproperty based on the value selected for thevalueproperty. -
Determine whether the
dateproperty is shown or hidden based on the value of thehasDateproperty.
Conditionals: example twoLink copied!
This example shows the use of multiple conditional fields.
- condition1 will hide the
altTextproperty until an image has been added. - condition2 enables the author name field if a publication date is chosen. It sets the
authorNameto be readOnly ifdateis null. - condition3 uses the value of the
switchboolean property to show additional properties for an image or video. - condition4 will add additional fields for custom width and height if the value of the
dropListproperty indicates that a custom aspect ratio is selected. - condition5 adds additional fields for width, height and margin if any text is entered in the libraryIcon text field.