Subversion Repositories Applications.papyrus

Rev

Rev 1318 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1318 alexandre_ 1
/*
2
	Copyright (c) 2004-2006, The Dojo Foundation
3
	All Rights Reserved.
4
 
5
	Licensed under the Academic Free License version 2.1 or above OR the
6
	modified BSD license. For more information on Dojo licensing, see:
7
 
8
		http://dojotoolkit.org/community/licensing.shtml
9
*/
10
 
1422 alexandre_ 11
 
12
 
1318 alexandre_ 13
dojo.provide("dojo.validate.us");
14
dojo.require("dojo.validate.common");
15
dojo.validate.us.isCurrency = function (value, flags) {
16
	return dojo.validate.isCurrency(value, flags);
17
};
18
dojo.validate.us.isState = function (value, flags) {
19
	var re = new RegExp("^" + dojo.regexp.us.state(flags) + "$", "i");
20
	return re.test(value);
21
};
22
dojo.validate.us.isPhoneNumber = function (value) {
23
	var flags = {format:["###-###-####", "(###) ###-####", "(###) ### ####", "###.###.####", "###/###-####", "### ### ####", "###-###-#### x#???", "(###) ###-#### x#???", "(###) ### #### x#???", "###.###.#### x#???", "###/###-#### x#???", "### ### #### x#???", "##########"]};
24
	return dojo.validate.isNumberFormat(value, flags);
25
};
26
dojo.validate.us.isSocialSecurityNumber = function (value) {
27
	var flags = {format:["###-##-####", "### ## ####", "#########"]};
28
	return dojo.validate.isNumberFormat(value, flags);
29
};
30
dojo.validate.us.isZipCode = function (value) {
31
	var flags = {format:["#####-####", "##### ####", "#########", "#####"]};
32
	return dojo.validate.isNumberFormat(value, flags);
33
};
34