title: Adding a select box using Javascript; to a html form that is populated by PHP
body: <p>Bit of a badly written question, but basically I have a Form for users adding their values to the database. One of the fields needs a drop down box that is populated with the values in my database field. However the user may want to have more than one select box (all the drop down selections need to post to the same database field).</p>
  
  <pre><code>&lt;form method="POST" action="addcocktail.php" &gt;
                      &lt;tr&gt;&lt;td&gt;Cocktail Name: &lt;/td&gt;&lt;td&gt;&lt;input type="text" name="cocktailname" /&gt; &lt;/td&gt;&lt;/tr&gt;
                      &lt;tr&gt;&lt;td&gt;Ingredients: &lt;/td&gt;&lt;td&gt;&lt;input type="text" name="ingredients" /&gt; &lt;/td&gt;&lt;/tr&gt;
                      &lt;select name="ingredientselect"&gt; 
                      &lt;option value="" selected="selected"&gt;Ingredient&lt;/option&gt;
                      &lt;option value="" selected="selected"&gt;Ingredient&lt;/option&gt;
                      &lt;/select&gt;
                      &lt;input type="button" id="addingred" onclick="addTextboxes();" value="Add Ingredient"&gt;
                      &lt;tr&gt;&lt;td&gt;How To: &lt;/td&gt;&lt;td&gt;&lt;input type="text" name="howto" /&gt; &lt;/td&gt;&lt;/tr&gt;
                  &lt;input type="submit" value="add" /&gt;
                  &lt;/form&gt;
  </code></pre>
  
  <p><strong>I need a Javascript function that will basically duplicate one of my select options, so the user can choose how many "ingredients" they want; on button click. (I've been playing around with the addElement but to no avail)</strong></p>
  
  <p><strong>And Im also wondering how to pull the database values straight into the select box options.</strong></p>
  
  <p>Any help is apppreciated, thanks -Matt</p>