Side navigation
#2931 closed bug (fixed)
Opened May 24, 2008 12:41PM UTC
Closed May 25, 2008 11:36AM UTC
[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.