Bug Tracker

Ticket #2931 (closed bug: fixed)

Opened 8 months ago

Last modified 8 months ago

[validate] form elements not ordered

Reported by: adamschlag Assigned to: joern
Type: bug Priority: minor
Milestone: 1.3 Component: plugin
Version: 1.2.5 Keywords: validate
Cc: Needs: Review

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

jquery.validate.fixorder.patch (0.7 kB) - added by adamschlag 8 months ago.
fixes form element selector to get elements in order

Change History

Changed 8 months ago by adamschlag

fixes form element selector to get elements in order

Changed 8 months ago by flesler

  • owner set to joern

Changed 8 months ago by joern

  • status changed from new to closed
  • resolution set to fixed

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

Note: See TracTickets for help on using tickets.