How do I make a drop down box that when the value is selected it will create that many more text fields on the same form.
I have a select option field that asks "how many categories do you need? 1-6" If the user selects 3 it will on the same form create 3 new text fields asking the user to input the name of each category. If it is 6 categories then it will generate 6 text fields.
Once the submit button is clicked the data goes to the insert page and the database is updated. My problem is generating the new text fields based up on the select option value.
<select name="num_cat" onchange="document.textbox.value=this.value">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
</select>
<input type="text" name="textbox" id="textbox">
<?php
If $_POST[num_cat] == 1{
echo ;
}else
?>
and that is where i get lost. In the database I have fields for Category1, Category2, etc... and these fields would be filled in by the values of the text fields generated.
If anyone has any suggestions or examples I would be very greatful. Thank You.
~G~