mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-28 06:42:14 +09:00
fix typo : minlen -> minlength, maxlen -> maxlength
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@7331 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
3ef3a36d43
commit
df6b14ce57
2 changed files with 8 additions and 8 deletions
|
|
@ -58,13 +58,13 @@ describe('Validator', {
|
|||
},
|
||||
'validate with length' : function() {
|
||||
v.cast('ADD_FILTER', ['minlen', {
|
||||
'text' : {required:true, minlen:5}
|
||||
'text' : {required:true, maxlength:5}
|
||||
}]);
|
||||
v.cast('ADD_FILTER', ['maxlen', {
|
||||
'text' : {required:true, maxlen:10}
|
||||
'text' : {required:true, maxlength:10}
|
||||
}]);
|
||||
v.cast('ADD_FILTER', ['minmaxlen', {
|
||||
'text' : {required:true, minlen:5, maxlen:10}
|
||||
'text' : {required:true, maxlength:5, maxlength:10,rule:'userid'}
|
||||
}]);
|
||||
|
||||
set_filter('minlen');
|
||||
|
|
@ -88,13 +88,13 @@ describe('Validator', {
|
|||
set_value('1');
|
||||
value_of(validate()).should_be_false();
|
||||
|
||||
set_value('12345678901');
|
||||
set_value('a12345678901');
|
||||
value_of(validate()).should_be_false();
|
||||
|
||||
set_value('12345');
|
||||
set_value('a12345');
|
||||
value_of(validate()).should_be_true();
|
||||
|
||||
set_value('1234567');
|
||||
set_value('a1234567');
|
||||
value_of(validate()).should_be_true();
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -98,8 +98,8 @@ var Validator = xe.createApp('Validator', {
|
|||
if (!_el) return true;
|
||||
|
||||
var el = $(_el), val = $.trim(get_value(el));
|
||||
var minlen = parseInt(this.minlen) || 0;
|
||||
var maxlen = parseInt(this.maxlen) || 0;
|
||||
var minlen = parseInt(this.minlength) || 0;
|
||||
var maxlen = parseInt(this.maxlength) || 0;
|
||||
var rule = (this.rule || '').split(',');
|
||||
|
||||
if (this.required && !val) return (result = (!!self.cast('ALERT', [form, name, 'isnull']) && false));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue