Featured Posts

Fixed: The selected configuration for displays could... f After installing Ubuntu 12.04 and selecting the proper driver for my ATI graphics card, I couldn't get my 2 monitors to work like I wanted them to be. I got the following...

Readmore

.NET Validators: How to set them as 'display: none;'... I came across the issue that .Net would set the validators as a hidden span, using 'visibilty: hidden;', rather than really not displaying at all. After a simple search...

Readmore

jQuery Autocomplete: How To Search From The Start I came across a problem using the autocomplete function in jQuery. I use a search for countries, and I want the result to start with the letter I fill in the textbox, but...

Readmore

ShareGroundz Rss

jQuery Autocomplete: How To Search From The Start

Posted on : 21-03-2011 | By : CasB | In : News

Tags: , , , ,

0

I came across a problem using the autocomplete function in jQuery.

I use a search for countries, and I want the result to start with the letter I fill in the textbox, but instead, I got all the results containing the user input.

I spent some time searching for an answer, but I couldn’t find anything, so I started to look in the source (in my case: jquery-ui-1.8.9-custom.min.js).

In the autocomplete function, I ended up changing this:

filter:function(a,b){var f=new RegExp(d.ui.autocomplete.escapeRegex(b),"i");

to this:


filter:function(a,b){var f=new RegExp("^" + d.ui.autocomplete.escapeRegex(b),"i");

Now it finally works properly.

Don’t you just love it when Phil Hellmuth gets a bad beat?

Posted on : 15-02-2011 | By : CasB | In : News

Tags: ,

0

More poker videos

I guess this pretty much sums up what’s going on right now

Posted on : 11-12-2010 | By : CasB | In : News

Tags: , , , ,

0

Sharegroundz is reborn

Posted on : 08-12-2010 | By : CasB | In : News

Tags: ,

0

After a few years I’ve decided to throw the old Sharegroundz out of the door. The stuff that was on it was available on sites that are many times better than mine. So, now it’ll become a blog about the stuff I come across the internet and like, and therefor, want to share.