Page 1 of 1

Jquery w/ autocomplete & case-insensitivity

Posted: Fri Oct 26, 2007 4:31 pm
by arpowers
hey guys!

I'm trying to do an autocomplete form w/ jquery ...
I want to replace the matched characters with a bold field but I'm having a problem making this case-insensitive...
my code:

Code: Select all

     var input = $("#auto_contact").val();
                       
                        var newrow = thisrow[0].replace(input,"<strong>"+input+"</strong>");
                       
                        return newrow;

the W3 says that the replace function would perform a case insensitive search if if put: /search value/i but it won't work with this variable.. Im guessing cuz its a quoted string???

http://www.w3schools.com/jsref/jsref_replace.asp

Please help .. thanks a lot![/syntax]