JQuery.Validate failure in Opera

Question :

JQuery.Validate failure in Opera,

Answer :

If you’re using Opera 9.5x you may notice that our client-side 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.

Read More  Assignment inside Perl ternary conditional operator problems

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?

,

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. 🙂

That’s the answer JQuery.Validate failure in Opera, Hope this helps those looking for an answer. Then we suggest to do a search for the next question and find the answer only on our site.

Read More  How can I convert IEnumerable to List in C#? June 10, 2022 by Eiji I am using LINQ to query a generic dictionary and then use the result as the datasource for my ListView (WebForms). Simplified code: Dictionary dict = GetAllRecords(); myListView.DataSource = dict.Values.Where(rec => rec.Name == "foo"); myListView.DataBind(); I thought that would work but in fact it throws a System.InvalidOperationException : ListView with id ‘myListView’ must have a data source that either implements ICollection or can perform data source paging if AllowPaging is true. In order to get it working I have had to resort to the following: Dictionary dict = GetAllRecords(); List searchResults = new List(); var matches = dict.Values.Where(rec => rec.Name == "foo"); foreach (Record rec in matches) searchResults.Add(rec); myListView.DataSource = searchResults; myListView.DataBind(); Is there a small gotcha in the first example to make it work? (Wasn’t sure what to use as the question title for this one, feel free to edit to something more appropriate) Try this: var matches = dict.Values.Where(rec => rec.Name == "foo").ToList(); Be aware that that will essentially be creating a new list from the original Values collection, and so any changes to your dictionary won’t automatically be reflected in your bound control. Categories question Post navigation .NET unit testing packages Authenticating Domain Users with System.DirectoryServices

Disclaimer :

The answers provided above are only to be used to guide the learning process. The questions above are open-ended questions, meaning that many answers are not fixed as above. I hope this article can be useful, Thank you