I have this section of code:
<select id="frm_type" name="typeId">
<?php foreach($product_types as $product) : ?>
<?php if ($product['id'] == $product_details['typeId']) $selected = " SELECTED"; else $selected = ""; ?>
<option value="<?=$product['id'];?>"<?=$selected;?>><?=$product['partNumber'];?> (<?=$product['title'];?>)</option>
<?php endforeach; ?>
</select>
This just populates a drop list/option box with data from a DB. This works fine in a form for create where an item is being selected and posted, however I want this same function on an edit page.
The edit page displays the currently selected values, and if unchanged, on post, nothing is posted from this input.
I believed the bits where I have used $selected… in the above, shows the selected option(which it does) it just doesnt send the selected data.
Could anyone offer any suggestions.
try