value="<?php echo (isset($_REQUEST['recipe_name'])) ? $_REQUEST['recipe_name'] : ''; ?>"
name="ingredient[<?php $i ?>][amount]"
name="ingredient[0][amount]"name="ingredient[1][amount]"name="ingredient[2][amount]"
I have fields set as required so that if the form is submitted and those fields are not defined, an error displays.
Unfortunately, any field values that were entered do not redisplay so the user would have to enter them again.
I was able to use the following to get simple fields displaying the value:
But here's where I run into an issue. How would I get it to work for an array field that has a name like:
The variable $i will be a number that corresponds to the number of the entry. So if 3 ingredient amounts were entered it would be: