Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JQuery.Validate failure in Opera

If you're using Opera 9.5x you may notice that our client-side JQuery.Validate code is disabled here at Stack Overflow.

function initValidation() {
    if (navigator.userAgent.indexOf("Opera") != -1) return;
    $("#post-text").rules("add", { required: true, minlength: 5 });
}

That's because it generates an exception in Opera! Of course it works in every other browser we've tried. I'm starting to seriously, seriously hate Opera.

This is kind of a bummer because without proper client-side validation some of our requests will fail. We haven't had time to put in complete server-side messaging when data is incomplete, so you may see the YSOD on Opera much more than other browsers, if you forget to fill out all the fields on the form.

Any Opera-ites want to uncomment those lines (they're on core Ask & Answer pages like this one -- just View Source and search for "Opera") and give it a go?

like image 468
Jeff Atwood Avatar asked Aug 12 '08 11:08

Jeff Atwood


1 Answers

turns out the problem was in the

{ debug : true }

option for the JQuery.Validate initializer. With this removed, things work fine in Opera. Thanks to Jörn Zaefferer for helping us figure this out!

Oh, and the $50 will be donated to the JQuery project. :)

like image 102
Jeff Atwood Avatar answered Sep 19 '22 12:09

Jeff Atwood