I have a problem with an extension I am developing with OpenCart.
I have a select dropdown menu and I am want to use the selected function so that a certain option is selected. However the top entry is always being selected.
For example here is my code:
<select name="agent_status">
<option value="1" <?php if($status == '1') echo "selected"; ?>>Enabled</option>
<option value="0" <?php if($status == '0') echo "selected"; ?>>Disabled</option>
</select>
However the top option is always the default option even if I it should be the bottom option.
I can confirm that it is not a PHP error as I checked the source and the tag does end in selected. I have also tried using different browsers.
My bad,
It came down to a caching problem!
Thanks for anyone who was about to answer