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.widget.RegexpTextbox");
|
|
|
14 |
dojo.require("dojo.widget.ValidationTextbox");
|
|
|
15 |
dojo.widget.defineWidget("dojo.widget.RegexpTextbox", dojo.widget.ValidationTextbox, {mixInProperties:function (localProperties, frag) {
|
|
|
16 |
dojo.widget.RegexpTextbox.superclass.mixInProperties.apply(this, arguments);
|
|
|
17 |
if (localProperties.regexp) {
|
|
|
18 |
this.flags.regexp = localProperties.regexp;
|
|
|
19 |
}
|
|
|
20 |
if (localProperties.flags) {
|
|
|
21 |
this.flags.flags = localProperties.flags;
|
|
|
22 |
}
|
|
|
23 |
}, isValid:function () {
|
|
|
24 |
var regexp = new RegExp(this.flags.regexp, this.flags.flags);
|
|
|
25 |
return regexp.test(this.textbox.value);
|
|
|
26 |
}});
|
|
|
27 |
|