Welcome Guest, Not a member yet? Register   Sign In
Help - Validate & Repopulate a Dropdown?
#1

[eluser]hawthornpublications[/eluser]
I've used the form_dropdown function to generate a dropdown menu using an array of options. After the form fails validation, I want the dropdown to maintain the selection but can't figure out how to do it.
Code:
$meals = array(
'select_one' => 'Select One',
'breakfast' => 'Breakfast',
'lunch' => 'Lunch',
'dinner' => 'Dinner'
);

...

<?= form_dropdown('meals', $meals, 'select_one') ?>

In the form_dropdown function I have the default currently set to
Code:
'select_one'
but I imagine that's where I might put
Code:
$this->validation->meals
or something similar.. but it doesn't work.

Any ideas? Smile


Messages In This Thread
Help - Validate & Repopulate a Dropdown? - by El Forum - 08-07-2008, 12:23 PM
Help - Validate & Repopulate a Dropdown? - by El Forum - 08-07-2008, 12:36 PM
Help - Validate & Repopulate a Dropdown? - by El Forum - 08-18-2008, 01:09 PM
Help - Validate & Repopulate a Dropdown? - by El Forum - 08-18-2008, 01:44 PM
Help - Validate & Repopulate a Dropdown? - by El Forum - 08-18-2008, 01:47 PM



Theme © iAndrew 2016 - Forum software by © MyBB