yav - javascript validation tool
Home
Download
|
Support
Documentation
Getting started
Validation rules
Multi-language support
Learn by example
Simple registration form
Notification of changes
Newsletter Sign-up
Captcha
The andor-operator
Pre/Post/Implies rules
Working with the masks
Custom validation
Support
Discussion group
Mailing list
E-mail contact
Example 7
Here you can learn more about the masks.
'alphabetic' is a mask embedded into Yav.
'mydate' is a mask added with the function
yav.addMask
.
If Yav doesn't find the named mask it uses the characters in the name as the ones accepted (e.g. '
.01
').
source
var rules=new Array(); rules[0]='alphabetic|required'; rules[1]='date|required'; rules[2]='date|date'; rules[3]='alphabetic|mask|alphabetic'; rules[4]='date|mask|mydate'; rules[5]='custom|mask|01.'; yav.addHelp('alphabetic', 'This field only accepts alphabetic characters'); yav.addHelp('date', 'This field only accepts dates with mask dd-dd-dddd'); yav.addHelp('custom', 'This field only accepts the characters: .01'); yav.addMask('mydate', ' - - ', '1234567890');
Working with the masks
Alphabetic:
Date:
Custom:
Copyright 2005-2008. All rights reserved.