Welcome Guest, Not a member yet? Register   Sign In
checkboxes
#1

[eluser]basty_dread[/eluser]
i am new to codeigniter. i would like to know, how could i checked the checkbox from my form after getting the value from the database. for example there is a value on my database that the checkbox is checked. then if i load the page it will get the value from the database and then if it is checked. then it will load the form and the checkbox is checked. please help. thank you
#2

[eluser]Zeeshan Rasool[/eluser]
Welcome to CI world...!!!
After getting the check box value Use it like this:
Code:
$data = array(
                                            'name'        => 'show_in_header',
                                            'id'          => 'show_in_header',
                                            'value'       => '1',
                                            'checked'     => (($show_in_header) ? $show_in_header : ''),
);
echo form_checkbox($data)
#3

[eluser]basty_dread[/eluser]
thank you zeshall.. thanks for the post and help.
#4

[eluser]Zeeshan Rasool[/eluser]
you're welcome my friend ;-)




Theme © iAndrew 2016 - Forum software by © MyBB