mirror of
https://github.com/jquery-validation/jquery-validation.git
synced 2025-12-24 12:13:59 +01:00
@@ -1187,19 +1187,19 @@ $.extend( $.validator, {
|
||||
|
||||
// http://jqueryvalidation.org/minlength-method/
|
||||
minlength: function( value, element, param ) {
|
||||
var length = $.isArray( value ) ? value.length : this.getLength( $.trim( value ), element );
|
||||
var length = $.isArray( value ) ? value.length : this.getLength( value, element );
|
||||
return this.optional( element ) || length >= param;
|
||||
},
|
||||
|
||||
// http://jqueryvalidation.org/maxlength-method/
|
||||
maxlength: function( value, element, param ) {
|
||||
var length = $.isArray( value ) ? value.length : this.getLength( $.trim( value ), element );
|
||||
var length = $.isArray( value ) ? value.length : this.getLength( value, element );
|
||||
return this.optional( element ) || length <= param;
|
||||
},
|
||||
|
||||
// http://jqueryvalidation.org/rangelength-method/
|
||||
rangelength: function( value, element, param ) {
|
||||
var length = $.isArray( value ) ? value.length : this.getLength( $.trim( value ), element );
|
||||
var length = $.isArray( value ) ? value.length : this.getLength( value, element );
|
||||
return this.optional( element ) || ( length >= param[ 0 ] && length <= param[ 1 ] );
|
||||
},
|
||||
|
||||
|
||||
@@ -236,7 +236,7 @@ test("minlength", function() {
|
||||
param = 2,
|
||||
e = $("#text1, #text1c, #text2, #text3");
|
||||
ok( method.call( v, e[0].value, e[0], param), "Valid text input" );
|
||||
ok(!method.call( v, e[1].value, e[1], param), "Invalid text input" );
|
||||
ok( method.call( v, e[1].value, e[1], param), "Valid text input" );
|
||||
ok(!method.call( v, e[2].value, e[2], param), "Invalid text input" );
|
||||
ok( method.call( v, e[3].value, e[3], param), "Valid text input" );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user