Welcome Guest, Not a member yet? Register   Sign In
combining form_dropdown() und set_select()
#2

[eluser]Erwin Setiawan[/eluser]
In ci 1.7
I know that you wantSmile
I used set_value() from form_validation library..
not set_select()
in controller:
Code:
$options = array(
                  'small'  => 'Small Shirt',
                  'med'    => 'Medium Shirt',
                  'large'   => 'Large Shirt',
                  'xlarge' => 'Extra Large Shirt',
                );
then in view:
Code:
form_dropdown('shirts', $options, 'large');
change 'larger' to set_value('shirts')
so your code will be:
Code:
form_dropdown('shirts', $options, set_value('shirts'));
Don't forget to add validation rules on shirts dropdown.
Hope it useful for youSmile


Messages In This Thread
combining form_dropdown() und set_select() - by El Forum - 11-21-2008, 05:03 AM
combining form_dropdown() und set_select() - by El Forum - 11-21-2008, 09:21 AM
combining form_dropdown() und set_select() - by El Forum - 11-22-2008, 09:14 AM
combining form_dropdown() und set_select() - by El Forum - 11-23-2008, 08:12 PM
combining form_dropdown() und set_select() - by El Forum - 11-30-2008, 06:51 AM
combining form_dropdown() und set_select() - by El Forum - 11-30-2008, 06:55 AM
combining form_dropdown() und set_select() - by El Forum - 11-30-2008, 11:22 AM
combining form_dropdown() und set_select() - by El Forum - 12-04-2008, 10:01 AM
combining form_dropdown() und set_select() - by El Forum - 12-06-2008, 11:59 AM
combining form_dropdown() und set_select() - by El Forum - 12-08-2008, 09:00 AM
combining form_dropdown() und set_select() - by El Forum - 12-10-2008, 03:43 AM
combining form_dropdown() und set_select() - by El Forum - 12-10-2008, 03:55 AM



Theme © iAndrew 2016 - Forum software by © MyBB