Conditional Field Example

Modify the inputs to see the conditional fields appear or disappear based on the logic defined in their data-storepress-conditional-field attribute.

data-storepress-conditional-field--relation="OR"

1. Basic String & Boolean Conditions

Text Input (STRING)

✅ Visible! Value is "show".
✅ Visible! Case-sensitive match.

Boolean (Exists)

✅ Visible! Input is not empty.
✅ Visible! Input is empty.

Select Input

✅ Visible! Option B is selected.
2. Number (Length) & MINMAX Conditions

NUMBER (Length)

✅ Visible! Length is 5.
✅ Visible! Length > 3.
✅ Visible! Length <= 3.

MINMAX (Length Range)

✅ Visible! Length is between 10 and 20.
✅ Visible! Length is at least 5.
3. Range (Value) Conditions (ONLY for "number" and "range" input type)

Number Input (RANGE)

✅ Visible! Value is between 10 and 20.

Range Slider Input

✅ Visible! Value is > 75.
✅ Visible! Value is 50.
4. Array-Based Conditions

STRING-ARRAY (Select)

✅ Visible! Value is in ["A", "C"].

STRING-ARRAY (Checkboxes - Any Match)

✅ Visible! Red or Blue is checked.

STRING-ARRAY (Checkboxes - All Match)

✅ Visible! Red AND Blue are checked.

STRING-ARRAY (Checkboxes - Exact Match)

✅ Visible! Exactly Red AND Blue are checked..

STRING-ARRAY (Select Multiple - Any Match)

✅ Visible! Apple or Orange are selected.

STRING-ARRAY (Select Multiple - All Match)

✅ Visible! Apple and Orange are selected.

STRING-ARRAY (Select Multiple - Exact Match)

✅ Visible! Exactly Apple and Orange are selected.

NUMBER-ARRAY (Length)

✅ Visible! Length is 3, 5, or 7.
5. Advanced Conditions (RegExp, Element)

REGEXP

✅ Visible! Value looks like an email.

ELEMENT (Value Equals Other Element's Value)

✅ Visible! Passwords match.

ELEMENT (Length Equals Other Element's Value)

✅ Visible! Text length matches the number.

ELEMENT (Value in Range of Other Element's Values)

✅ Visible! "Check" value is within the Min/Max range.

ELEMENT (Check Visibility)

I am the element to show on check name.
✅ Visible! The red element above is visible.
6. Relational Logic (AND, OR)

AND Relation

✅ Visible! Both A and B are correct.
✅ Visible! Both A and B are correct.

OR Relation

✅ Visible! Either A or B is correct.
✅ Visible! Both A and B are correct.

Complex AND/OR

✅ Visible! Text is "start" AND (A or B is checked).
7. `inert` Inversion Logic

Inert on Match

I am visible by default. Typing "hide" will match the condition and apply `inert`, hiding me.
8. Form Reset
This box will disappear when you type, and reappear on form reset.