Bug Tracker

Opened 12 years ago

Closed 12 years ago

Last modified 8 years ago

#2424 closed bug (fixed)

[validate] custom rule dont work with maxlength property.

Reported by: vinipitta Owned by: joern
Priority: major Milestone: 1.2.3
Component: plugin Version: 1.2.1
Keywords: validate Cc:
Blocked by: Blocking:

Description

PLUGIN: Validate VERSION: 1.2.1

A custom rule don't work if the maxlength property of the input field is defined. I created an example that illustrate the bug. There are two input text fields and both are validated by the same rule. The first have the maxlength property defined. The custom rule show a alert message with the field name. The first field will be checked only when there is some text in the field because in other way, the maxlength rule will return a dependecy-mismatch and the check method will abort the execution. The second field will be aways checked because it has not the maxlength property. This execution flow can be easy checked using the firebug plugin of Firefox to debug the js execution. See the check method starting in the 411 line when the rules for the element are retrieved.

Attachments (1)

test.html (1.6 KB) - added by vinipitta 12 years ago.
Showcase of the bug.

Download all attachments as: .zip

Change History (6)

Changed 12 years ago by vinipitta

Attachment: test.html added

Showcase of the bug.

comment:1 Changed 12 years ago by joern

Milestone: 1.2.41.2.3
Owner: set to joern
Version: 1.2.31.2.1

comment:2 Changed 12 years ago by gregers

I think this might be related to the bug I reported last week: http://dev.jquery.com/ticket/2473

If a field has multiple tests, and one of the tests returns "dependency-mismatch", it will stop further testing of this field and return without any value. I believe it should continue to do the other tests, and if none of them fail, it can return without any value. This is fixed in my patch.

comment:3 Changed 12 years ago by joern

Resolution: duplicate
Status: newclosed

Duplicate of #2473.

comment:4 Changed 12 years ago by joern

Resolution: duplicate
Status: closedreopened

I take that back. The issue described in #2473 is similar, but not the same.

comment:5 Changed 12 years ago by joern

Resolution: fixed
Status: reopenedclosed

Fixed in [5098].

Note: See TracTickets for help on using tickets.