flymis/WebRoot/dojojs/src/widget/UsTextbox.js
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
http://dojotoolkit.org/community/licensing.shtml
*/
dojo.provide("dojo.widget.UsTextbox");
dojo.require("dojo.widget.ValidationTextbox");
dojo.require("dojo.validate.us");
dojo.widget.defineWidget(
"dojo.widget.UsStateTextbox",
dojo.widget.ValidationTextbox,
{
// summary: a Textbox which tests for a United States state abbreviation
// allowTerritories Allow Guam, Puerto Rico, etc. Default is true.
// allowMilitary Allow military 'states', e.g. Armed Forces Europe (AE). Default is true.
mixInProperties: function(/*Object*/localProperties){
// summary: see dojo.widget.Widget
// Initialize properties in super-class.
dojo.widget.UsStateTextbox.superclass.mixInProperties.apply(this, arguments);
// Get properties from markup attributes, and assign to flags object.
if(localProperties.allowterritories){
this.flags.allowTerritories = (localProperties.allowterritories == "true");
}
if(localProperties.allowmilitary){
this.flags.allowMilitary = (localProperties.allowmilitary == "true");
}
},
isValid: function(){
// summary: see dojo.widget.ValidationTextbox
return dojo.validate.us.isState(this.textbox.value, this.flags);
}
}
);
/*
****** UsZipTextbox ******
A subclass of ValidationTextbox.
Over-rides isValid to test if input is a US zip code.
Validates zip-5 and zip-5 plus 4.
*/
dojo.widget.defineWidget(
"dojo.widget.UsZipTextbox",
dojo.widget.ValidationTextbox,
{
// summary: a Textbox which tests for a United States postal code
isValid: function(){
// summary: see dojo.widget.ValidationTextbox
return dojo.validate.us.isZipCode(this.textbox.value);
后面还有 28 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。