CodeIgniter Forums
set_checkbox() problem - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: set_checkbox() problem (/thread-20286.html)



set_checkbox() problem - El Forum - 07-04-2009

[eluser]DominixZ[/eluser]
Hi,everyone

I just use set_checkbox() to manipulate data but I have found some bug that if i don't validate those checkboxes.

Code:
<input type="checkbox" name="registration_list_allow" value="yes"
                    <?=set_checkbox('registration_list_allow',set_value('registration_list_allow',$registration_list_allow),($registration_list_allow == "yes")?TRUE:FALSE)?> />

This code run fine but if i don't use

Code:
$this->form_validation->set_rules('registration_list_allow','List allow','');

set_checkbox() will always uncheck when validate is false.

Can you guide me how to use set_checkbox() for practical to use in add and edit form ?

P.S I use set_value because i use this form for add and edit.


set_checkbox() problem - El Forum - 07-04-2009

[eluser]TheFuzzy0ne[/eluser]
This has pretty much been dealt with [url="http://ellislab.com/forums/viewthread/121725/"]here[/url]. Please let me know if it doesn't.


set_checkbox() problem - El Forum - 07-04-2009

[eluser]DominixZ[/eluser]
Thank you. So it is bug , right?


set_checkbox() problem - El Forum - 07-04-2009

[eluser]TheFuzzy0ne[/eluser]
I believe so, yes.