I have a simple order form with name (text), date (date), and then 2 sets of dropdowns. Each set contains a dropdown for flange and one for quantity. Basically the set repeats a couple times giving the user the ability to select a flange and then quantity with each set.
The forms sends all of the data (name, date, dropdown values, quantitys etc) to the database. I have created an edit page. When I go to edit an order all the data populates (including the quantity dropdowns) except for the flange dropdowns. They are just default blank.Is there a way to have the flange dropdown populate to the previously selected values?
<div style="display:block;">
<label for="itemID">1:</label>
<select id="itemID" name="itemID" required value="<?php echo $row['itemID']; ?>">
<option value="1">Flange 1 @ $100</option>
<option value="2">Flange 2 @ $100</option>
<option value="3">Flange 3 @ $50</option>
<option value="4">Flange 4 @ $50</option>
<option value="5">Flange 5 @ $50</option>
</select>
<label for="quantity"></label>
<input type="number" id="quantity" name="quantity" min ='1' max='50' style="width: 3em" required value="<?php echo $row['quantity']; ?>">
</div>
<div style="display:block;">
<label for="itemID2">1:</label>
<select id="itemID2" name="itemID2" required value="<?php echo $row['itemID2']; ?>">
<option value="1">Flange 1 @ $100</option>
<option value="2">Flange 2 @ $100</option>
<option value="3">Flange 3 @ $50</option>
<option value="4">Flange 4 @ $50</option>
<option value="5">Flange 5 @ $50</option>
</select>
<label for="quantity2"></label>
<input type="number" id="quantity2" name="quantity2" min ='1' max='50' style="width: 3em" required value="<?php echo $row['quantity2']; ?>">
</div>
...