Subversion Repositories Applications.papyrus

Rev

Go to most recent revision | Details | 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
 
11
dojo.provide("dojo.validate.us");
12
dojo.require("dojo.validate.common");
13
dojo.validate.us.isCurrency = function (value, flags) {
14
	return dojo.validate.isCurrency(value, flags);
15
};
16
dojo.validate.us.isState = function (value, flags) {
17
	var re = new RegExp("^" + dojo.regexp.us.state(flags) + "$", "i");
18
	return re.test(value);
19
};
20
dojo.validate.us.isPhoneNumber = function (value) {
21
	var flags = {format:["###-###-####", "(###) ###-####", "(###) ### ####", "###.###.####", "###/###-####", "### ### ####", "###-###-#### x#???", "(###) ###-#### x#???", "(###) ### #### x#???", "###.###.#### x#???", "###/###-#### x#???", "### ### #### x#???", "##########"]};
22
	return dojo.validate.isNumberFormat(value, flags);
23
};
24
dojo.validate.us.isSocialSecurityNumber = function (value) {
25
	var flags = {format:["###-##-####", "### ## ####", "#########"]};
26
	return dojo.validate.isNumberFormat(value, flags);
27
};
28
dojo.validate.us.isZipCode = function (value) {
29
	var flags = {format:["#####-####", "##### ####", "#########", "#####"]};
30
	return dojo.validate.isNumberFormat(value, flags);
31
};
32