[eluser]Flying Fish[/eluser]
Thanks for the reply jedd. Not sure what 'variable name' you were referring to above, could you clarify for me?
the html generated by the form dropdown looks something like this...
[code]
<select id="order_quantity">
<option value="250">250</option>
<option value="500">500</option>
<option value="750">750</option>
<!-- continues to increment by 250's -->
</select>
[code]
I know if I put a value in the 3rd parameter, that it will select an option by default when the form is loaded
example: the code below would select the <option value="250">250</option>
[code]
echo form_dropdown("order_quantity", $order_quantity_inc250, '250', 'id="order_quantity"');
[code]
but let's say a user submits a form and it doesn't pass validation, I want to make sure the option they selected stays selected when the page refreshes. I don't want it to revert to the default value
for example: they select a quantity of 1000 and then fail validation, I don't want the dropdown to then select 250
from what I understand though, to accomplish that I need to insert this code into each <option> tag
[code]
<?php echo set_select('order_quantity', '250')?>
[code]
but I'm not sure how to do it...does that make sense?