/* PAX Validation demo
The below javascript will add validators to the given form: 'valForm', and set
the defined hints.
*/
valDict = {
'firstName': {
mask: [
{ mask: 'len', minLen: '2', maxLen: '20' }
],
hint: 'First name is not necessary, however it must be at least 2 chars, and no more than 20 chars, if entered'
},
'lastName': {
mask: 'notEmpty',
hint: 'You must specify a last name'
},
'email': {
mask: [
{ mask: 'email' },
{ mask: 'notEmpty' }
],
hint: 'The email address is mandatory, and must be a valid email address'
},
'country': {
mask: [
{ mask: 'notEmpty' },
{ mask: 'excludeSelect', exclude: [2] }
],
hint: 'You must select a favourite rugby team. It can\'t be New Zealand ;o)'
},
'postcode': {
mask: 'postcode',
hint: 'Australian post code (4 numbers)'
},
'level': {
mask: 'notEmpty',
hint: 'You must specify a level',
hintPos: { x: 78, y: 0 }
}
};
// Iinitialise form validation, once the DOM has loaded
pax.load.onloaded( function() {
pax.validate.initValidation( 'valForm', valDict );
} );