title: how to filter the contents of a listbox based on a text box value
body: <p>i have a html form which contains the following elements</p>
  
  <p>1) a list box (containing a list of filenames)</p>
  
  <pre><code>  s1.txt2013
    s2.txt2013
    s3.txt2012
    s4.txt2012
  </code></pre>
  
  <p>2) a text box (user enters a pattern say 2013)</p>
  
  <p>3) a button</p>
  
  <p>by default list box contains a the above mentioned 4 files names.</p>
  
  <p>when a user enter a a text in the text box (say for example he eneters 2013 in the text box), and press the button, then the list box contents should be filtered out according to the text mentioned in the text box</p>
  
  <p>so in this case after clicking the button, list box should only contain two values (i.e. only those values in which 2013 appears).</p>
  
  <pre><code>s1.txt2013
  s2.txt2013
  </code></pre>
  
  <p>how can i do this.
   i did the following way..
  i am using a javascript function which will take all the option values of the list box in a javascript array. now i am not able to search the array for 2013 and populate the same list box with the values containing 2013 in in.</p>
  
  <p>can anyone tell me how to do this?</p>