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.widget.UsTextbox");
12
dojo.require("dojo.widget.ValidationTextbox");
13
dojo.require("dojo.validate.us");
14
dojo.widget.defineWidget("dojo.widget.UsStateTextbox", dojo.widget.ValidationTextbox, {mixInProperties:function (localProperties) {
15
	dojo.widget.UsStateTextbox.superclass.mixInProperties.apply(this, arguments);
16
	if (localProperties.allowterritories) {
17
		this.flags.allowTerritories = (localProperties.allowterritories == "true");
18
	}
19
	if (localProperties.allowmilitary) {
20
		this.flags.allowMilitary = (localProperties.allowmilitary == "true");
21
	}
22
}, isValid:function () {
23
	return dojo.validate.us.isState(this.textbox.value, this.flags);
24
}});
25
dojo.widget.defineWidget("dojo.widget.UsZipTextbox", dojo.widget.ValidationTextbox, {isValid:function () {
26
	return dojo.validate.us.isZipCode(this.textbox.value);
27
}});
28
dojo.widget.defineWidget("dojo.widget.UsSocialSecurityNumberTextbox", dojo.widget.ValidationTextbox, {isValid:function () {
29
	return dojo.validate.us.isSocialSecurityNumber(this.textbox.value);
30
}});
31
dojo.widget.defineWidget("dojo.widget.UsPhoneNumberTextbox", dojo.widget.ValidationTextbox, {isValid:function () {
32
	return dojo.validate.us.isPhoneNumber(this.textbox.value);
33
}});
34