Jquery w/ autocomplete & case-insensitivity

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
arpowers
Forum Commoner
Posts: 76
Joined: Sun Oct 14, 2007 10:05 pm
Location: san diego, ca

Jquery w/ autocomplete & case-insensitivity

Post 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]
Post Reply