title: Javascript problem with search
body: <p>I am trying to write some code for a simple search function. Basically, I want to have an array of products, which are updated dynamically when a user clicks on a different radio button (i.e selecting the laptop radio button displays all products that are laptops).</p>
  
  <p>I want a slider which sets a price threshold, i.e if you put it really far left it will only display the cheaper laptops, really far right and it displays the more expensive ones.</p>
  
  <p>It doesn't need to query a database or anything like that, it only needs very limited functionality. My code at the moment is legacy code, originally I was going to put a search function, but I can't figure out how to do that at all.</p>
  
  <p>Can anyone help me with this please?</p>
  
  <p>Here is my code so far :</p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
          &lt;script type="text/javascript"&gt;
  
              var arrayOfProducts = new Array();
              arrayOfProducts[0] = "Dell Laptop";
              arrayOfProducts[1] = "Dell PC";
              arrayOfProducts[2] = "Neither";
  
              function processForm() 
              var newObj = document.createElement('div');
              var docBody = document.getElementsByTagName('body').item(0);
              docBody.appendChild(newObj);
              }
  
  
          &lt;/script&gt; 
      &lt;/head&gt;
      &lt;body&gt;
          &lt;form name="myForm"&gt;
              &lt;input label="What would you like to search for?"type="text" name="textBox" id="textBox"&gt;
              &lt;div id="products"&gt;
              &lt;input type="radio" name="laptop" value="laptop"&gt; Laptops
              &lt;input type="radio" name="pc" value="pc"&gt; PC's
              &lt;/div&gt;
          &lt;/form&gt;
          &lt;input type="button" value="Test" onclick="processForm()"&gt;
  
  
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>