jzaefferer/jquery-validation — Issue #244: required field's onblur after initial success breaks when followed by select box
Author: Scotchester
Created: 2011-11-02 20:40:38+00:00
State: open

Ok, so here's a wild one.

No matter what I did, I could not get my plain-jane text box with a simple required rule to throw an error without submitting the form. I stripped the page down to nothing but the single text box. It started working again. Started adding stuff back. Eventually, after enough guess-and-check, I discovered that it only stops working if the `select` box that follows it has greater than zero `option`s. (That is, an empty select box does not break it.)

[Please view this example page.](http://dev.stratejus.com/calc/broken.php)

To reproduce: enter any text into the High School Name field and tab or click away. You'll see the 'Ok!' from where I turned on Success messages to make sure it was trying to validate at all. Return to the High School Name field and delete what's there. The field should immediately report an error, but it does not, even if you changing focus.

[Now try on this page.](http://dev.stratejus.com/calc/working.php)

If you view source, you can verify that the ONLY difference between the two pages is that on the working one, I have commented out the lone `option` in the `select`. I've tested this on both Firefox 7 and Chrome 16.

I think this may be related to the following issues:
https://github.com/jzaefferer/jquery-validation/issues/139
https://github.com/jzaefferer/jquery-validation/issues/146
https://github.com/jzaefferer/jquery-validation/issues/220

I had several other instances of the same problem (required text boxes not failing onblur after initial success), but I was able to pin this one down very specifically to the `option` toggle, so I thought it was worth a new issue.

Thanks for any insight anyone can provide!