yav - javascript validation tool
Home
Download
|
Support
Documentazione
Come iniziare
Regole di validazione
Supporto multi-lingue
Impara per esempi
Form di registrazione
Notifica cambiamenti
Iscrizione newsletter
Captcha
Operatori and/or
Regole Pre/Post/Implies
Le maschere
Validazione custom
Supporto
Gruppo discussioni
Mailing list
Contatto e-mail
Example 5
This is an advanced example using the andor-operator.
Note that in some circumstances the error message is not linked to a particular field,
so Yav automatically uses the default position (i.e. the
errorsDiv
element).
source
var rules=new Array(); rules[0]='number:a number|required'; rules[1]='number|equal|1000|andor-operator'; rules[2]='number|numeric|andor-operator'; rules[3]='number|minlength|6|andor-operator'; rules[4]='number|maxlength|6|andor-operator'; rules[5]='2|and|3-4|andor-operator'; rules[6]='1|or|5|Your number must be a numeric (6 digits) OR the specific number 101.';
Advanced Example using the andor-operator
This field only accepts numbers with 6 digits or the number '101'.
Your number:
Copyright 2005-2008. All rights reserved.