I have a form where one of the fields can have an unknown number of inputs. I need a way for php to count the fields that have been populated and offer a blank field if required. I currently have 20 input fields like this:
So I am looking for a way to create the list from the array field and also to presumably have the form to submit only the ingredient fields.
Code:
<li><input type="text" name="ingredient[]" id="ingredient_1" size="80" value="<?php if (isset($_POST['ingredient'])) echo $_POST['ingredient']; ?>" /></li>