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).
<form method="POST" action="addcocktail.php" >
<tr><td>Cocktail Name: </td><td><input type="text" name="cocktailname" /> </td></tr>
<tr><td>Ingredients: </td><td><input type="text" name="ingredients" /> </td></tr>
<select name="ingredientselect">
<option value="" selected="selected">Ingredient</option>
<option value="" selected="selected">Ingredient</option>
</select>
<input type="button" id="addingred" onclick="addTextboxes();" value="Add Ingredient">
<tr><td>How To: </td><td><input type="text" name="howto" /> </td></tr>
<input type="submit" value="add" />
</form>
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)
And Im also wondering how to pull the database values straight into the select box options.
Any help is apppreciated, thanks -Matt