title: Double Dynamic Dropdown List
body: <p>I am making a 'search engine' for my database and I am limiting queries through the use of dropdowns as the values, so no wrong searches can be made. In short the searches will be done based on the columns and values. In this question I have reduced the amount of columns to three, as if you can help me make work 2, then hopefully I will understand to do myself more.</p>
  
  <p>First dropdown (column), corresponding dropdown with the new options (value).
  Second dropdown (column), corresponding dropdown with the new options (value).</p>
  
  <p>Indeed the first and second dropdown queries have the same column names, because we want to match two queries simaltaniously.    </p>
  
  <p>Current code: The first is a dropdown already, and it works perfectly. However, I tried a lot to make the second one a dropdown (which is easy), but then make it work like the first one, it didn't succeed.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      function setOptions(chosen) {
          var selbox = document.search.findone;
  
          selbox.options.length = 0;
          if (chosen == " ") {
              selbox.options[selbox.options.length] = new Option('Please select one of the options above first',' ');
          }
          if (chosen == "SHIPPINGLINE") {
              selbox.options[selbox.options.length] = new Option('MSC','MSC');
              selbox.options[selbox.options.length] = new Option('first choice - option two','onetwo');
          }
          if (chosen == "POL") {
              selbox.options[selbox.options.length] = new Option('HONG KONG','HONG KONG');
              selbox.options[selbox.options.length] = new Option('SHANGHAI','SHANGHAI');
          }
          if (chosen == "POD") {
              selbox.options[selbox.options.length] = new Option('HAMBURG','HAMBURG');
              selbox.options[selbox.options.length] = new Option('LE HAVRE','LE HAVRE');
          }
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>and further</p>
  
  <pre><code>&lt;div id="searchzone"&gt;
      &lt;h2&gt;Search&lt;/h2&gt;
      &lt;form name="search" method="post" action="&lt;?=$PHP_SELF?&gt;"&gt;
          &lt;Select NAME="fieldone"   onchange="setOptions(document.search.fieldone.options[document.search.fieldone.selectedInde    x].value);" id="fieldone"&gt;
              &lt;option value=" " selected="selected"&gt; &lt;/option&gt;
              &lt;option VALUE="SHIPPINGLINE"&gt;SHIPPING LINE&lt;/option&gt;
              &lt;option VALUE="POL"&gt;POL&lt;/option&gt;
              &lt;option VALUE="POD"&gt;POD&lt;/option&gt;
          &lt;/Select&gt;
          &lt;Select NAME="findone" /&gt;
  
          &lt;option value=" " selected="selected"&gt;Please select the category on the left first.&lt;/option&gt;
          &lt;/select&gt;
  
      &lt;br /&gt;
      &lt;br /&gt;
          &lt;Select NAME="fieldtwo"&gt;
              &lt;option VALUE="SHIPPINGLINE"&gt;SHIPPING LINE&lt;/option&gt;
              &lt;option VALUE="POL"&gt;POL&lt;/option&gt;
              &lt;option VALUE="POD"&gt;POD&lt;/option&gt;
          &lt;/Select&gt;
          &lt;input type="text" name="findtwo" /&gt;
          &lt;input type="hidden" name="searching" value="yes" /&gt;
          &lt;input type="submit" name="search" value="Search" /&gt;
      &lt;/form&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>maybe relevant for you to know, this is my sql query, it works fine :)</p>
  
  <pre><code>$data = mysql_query("SELECT * FROM tablename WHERE upper($fieldone) LIKE'%$findone%' AND upper($fieldtwo) LIKE'%$findtwo%'"); 
  </code></pre>
  
  <p>I would appreciate it a lot if you can help me out, if you need any other information, let me know!</p>