Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 163541
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T11:35:08+00:00 2026-05-11T11:35:08+00:00

I am trying to get John Resig’s jQuery Live Search with Quicksilver Style to

  • 0

I am trying to get John Resig’s jQuery Live Search with Quicksilver Style to work with a select multi form control. His code is based John Nunemaker’s Work developing his quicksilver.js code.

The problem I am having is that within a select box only Firefox supports .hide() on option values, I can’t figure out a snappy approach for IE, Safari, Opera and Chrome.

Here is an example, I have inlined John R’s code but you will need to grab quicksilver.js and host it locally yourself. Again this works great in Firefox but the call to rows.hide() does nothing on other browsers.

I have tried wrapping the tags in in a div and hiding that but no luck.

Any ideas?

<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01//EN' 'http://www.w3.org/TR/html4/strict.dtd'> <html> <head>   <meta http-equiv='Content-Type' content='text/html; charset=utf-8'>   <title>LiveSearch</title>   <script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js'></script>    <script type='text/javascript' src='../jquery/quicksilver.js'></script>    <script type='text/javascript' charset='utf-8'>      $(document).ready(function() {         $('#q').liveUpdate('#posts').focus();      });       jQuery.fn.liveUpdate = function(list){        list = jQuery(list);         if ( list.length ) {            // Changed 'li' to 'option' below            var rows = list.children('option'),               cache = rows.map(function(){               return this.innerHTML.toLowerCase();               });             this                .keyup(filter).keyup()                .parents('form').submit(function(){                    return false;                });        }         return this;         function filter(){            var term = jQuery.trim( jQuery(this).val().toLowerCase() ), scores = [];             if ( !term ) {                rows.show();            } else {                rows.hide();                 cache.each(function(i){                    var score = this.score(term);                    if (score > 0) { scores.push([score, i]); }                });                 jQuery.each(scores.sort(function(a, b){return b[0] - a[0];}), function(){                    jQuery(rows[ this[1] ]).show();                });            }        }      };    </script> </head> <body>  <form method='get' autocomplete='off' action=''>    <div>      <input type='text' value='' name='q' id='q'><br><br>       <select id='posts' multiple name='choices' SIZE='10' style='width: 250px'>         <option value='1'>The Well-Designed Web</option>         <option value='2'>Welcome John Nunemaker</option>         <option value='3'>Sidebar Creative: The Next Steps</option>         <option value='4'>The Web/Desktop Divide</option>         <option value='5'>2007 in Review</option>         <option value='6'>Don't Complicate the Solution</option>         <option value='7'>Blog to Business</option>         <option value='8'>Single Line CSS</option>         <option value='9'>The Great Divide</option>         <option value='10'>What's in a Name?</option>      </select>    </div>   </form>  </body> </html> 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T11:35:08+00:00Added an answer on May 11, 2026 at 11:35 am

    The best approach is just to add and remove options from the DOM.

    Like this:

      <script type='text/javascript' charset='utf-8'>      $(document).ready(function() {         $('#q').liveUpdate('#posts').focus();      });       jQuery.fn.liveUpdate = function(list){        list = jQuery(list);         if ( list.length ) {                // Changed 'li' to 'option' below                var rows = list.children('option'),                   cache = rows.map(function(){                   return this.innerHTML.toLowerCase();                   });                 var all = rows;                all.each(function(i){                   $(this).attr('itext', this.innerHTML.toLowerCase());                });                 this                        .keyup(filter).keyup()                        .parents('form').submit(function(){                                return false;                        });        }         return this;         function filter(){                var term = jQuery.trim( jQuery(this).val().toLowerCase() ), scores = [];                 if ( !term ) {                        list.append(all);                } else {                        rows.remove();                         all.each(function(i){                                var score = $(this).attr('itext').score(term);                                if (score > 0) { scores.push([score, i]); }                        });                         jQuery.each(scores.sort(function(a, b){return b[0] - a[0];}), function(){                                list.append(all[this[1]]);                        });                         rows = list.children('option');                }        }      };    </script> 

    EDIT:

    Need to score over array ‘all’ rather than rows.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get John Polacek's Superscrollorama jQuery plugin to work the parallax effect
I'm trying to get this Jquery.parseJson to work without success. <input type=text id=query /><button>search</button><br
I am trying to get the JQuery Token Input prepopulated. var assignUserJson=$('#assignUserJson').val(); console.log(assignUserJson); //[{id:1,name:Andrew},{id:3,name:John}]
For some reason, I can't get the John Resig micro template to work. I've
I'm TRYING to get jQuery .get to work. I have two files. I. Where
I am trying get Struts 2 and Tiles to work and I am using
Trying to get a wildcard search to pick up on any text in org_name
Trying to get this expression to work, can someone look at it and tell
We're trying to get 2-legged OAuth to work with the Gmail atom feed. We're
I am trying to get this result: <li class=beatle_1>Paul</li> <li class=beatle_2>John</li> <li class=beatle_3>George</li> <li

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.