Welcome Guest, Not a member yet? Register   Sign In
need help with checkbox
#1

[eluser]webstudent_101[/eluser]
well i have this in my view..

<?= form_open('merchant/result')?>
<? foreach($employees as $item):?>
&lt;?= form_checkbox('employee', $item->user_firstname)." - ".$item->user_firstname; ?&gt;<br/>
&lt;? endforeach;?&gt;
&lt;?= form_submit('submit', 'enter')?&gt;
&lt;?= form_close();?&gt;

and in the 'merchant/result' i wanted to get all the checked employee.. but every time i check all the last employee will be the only one to show.. is there a way to make the checked items an array or something? ive been searching the internet for quiet some time about codeigniter and multiple checked items with no possible aid ti my problem..

thanks alot.. and tnx in advance
#2

[eluser]Fireclave[/eluser]
you can use form_checkbox('employee[]'...)
so you have an array !
employee[] <- Array
#3

[eluser]webstudent_101[/eluser]
tnx alot.. ill try it right now.. XD
#4

[eluser]Fireclave[/eluser]
Here an example
http://www.plus2net.com/php_tutorial/array_checkbox.php

you are welcome
#5

[eluser]webstudent_101[/eluser]
yep works perfectly.. i changed it to multiselect() which made it much easier.. hehe.. jst added some line of codes in my form_helper for the dropdown function..




Theme © iAndrew 2016 - Forum software by © MyBB