Stages Demos:

[ Note: Stages comes without styles, you have to bring your own! ]

Validate On (Event)

You can set different validation behaviours on a field. Below are some examples. You have to interact with the form to experience the different behaviours.


Default: Validate on Form Button Actions (Submit):

path: required | type: text
path: email | type: email
path: optional | type: text




Validate on init (and submit):

path: required | type: text
path: email | type: email
path: optional | type: text





Validate on blur (and submit):

path: required | type: text
path: email | type: email
path: optional | type: text





Validate on change (and submit):

path: required | type: text
path: email | type: email
path: optional | type: text





Validate on throttled change (and submit):

path: required | type: text
path: email | type: email
path: optional | type: text





Dynamic validation based on length of input, first only on blur, than after five characters on change:

path: dynamicValidate | type: text





Custom validation event:

In this example, the form is validated on change, but the city field, is validated on countryChange, which is defined as "only validate on change, if country is selected and has less than 3 characters".

path: country | type: select

path: city | type: text



In this second example, we run validation on blur for short strings (less than 5 chars) in the input, and validation on change for long.

path: field1 | type: text



- - -
(c) 2023 by Fredi Bach : Unic : Github