Bug Tracker

Opened 12 years ago

Closed 12 years ago

#2931 closed bug (fixed)

[validate] form elements not ordered

Reported by: adamschlag Owned by: joern
Priority: minor Milestone: 1.3
Component: plugin Version: 1.2.5
Keywords: validate Cc:
Blocked by: Blocking:

Description

I'm using the validate plugin for a project I'm working on, and during my testing I noticed that my first form element (a select) was not getting focus when it wasn't filled in, and instead the first invalid input element was focused instead. After digging in the validate code, I noticed that the form elements are selected with this selector:

filter("input, select, textarea")

Which, of course, selects all the input elements before any other element.

Updating the selector to:

filter(":input")

does the trick (at least for me...I've not tested it on anything but my own code). My patch also adds :image to the exclusion filter, since it wasn't there before.

Attachments (1)

jquery.validate.fixorder.patch (680 bytes) - added by adamschlag 12 years ago.
fixes form element selector to get elements in order

Download all attachments as: .zip

Change History (3)

Changed 12 years ago by adamschlag

fixes form element selector to get elements in order

comment:1 Changed 12 years ago by flesler

Owner: set to joern

comment:2 Changed 12 years ago by joern

Resolution: fixed
Status: newclosed

Fixed in [5691], applied both the :input fix for ordering and the :image exclusion.

Note: See TracTickets for help on using tickets.