Remove clearing as numbers of min, max and range rules. Fixes #455. Closes gh-528.

These rules are fully suitable to check any comparable JavaScript objects such as strings or dates. Also clearing prevents HTML5 date input fields to work when these rules are coming from HTML.
This commit is contained in:
Alexander I. Zaytsev
2012-11-29 19:12:45 +13:00
committed by Jörn Zaefferer
parent a047634196
commit 69831a08cf
4 changed files with 138 additions and 4 deletions

View File

@@ -205,7 +205,7 @@ test("rules(), add and remove", function() {
deepEqual( $("#v2-i5").rules(), { required: true, minlength: 2, maxlength: 5, customMethod1: "123" });
$("#v2-i5").addClass("email").attr({min: 5});
deepEqual( $("#v2-i5").rules(), { required: true, email: true, minlength: 2, maxlength: 5, min: 5, customMethod1: "123" });
deepEqual( $("#v2-i5").rules(), { required: true, email: true, minlength: 2, maxlength: 5, min: "5", customMethod1: "123" });
$("#v2-i5").removeClass("required email").removeAttrs("minlength maxlength customMethod1 min");
deepEqual( $("#v2-i5").rules(), {});