CodeIgniter Forums
Codeigniter form checkbox group validation without using jquery or javascript - 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: Codeigniter form checkbox group validation without using jquery or javascript (/thread-60289.html)



Codeigniter form checkbox group validation without using jquery or javascript - El Forum - 02-23-2014

[eluser]Unknown[/eluser]
Just want to validate with codeigniter if at least one of the following checkbox fields is checked (without using jquery or javascript). Please help me Smile

Code:
$data = array(
             'name'        => 'cat',
             'id'          => 'cat',
             'value'       => 'accept',
             'checked'     => FALSE,
             'style'       => 'margin:10px',
             );
             echo form_checkbox($data);
             echo form_label("Cat<br>","cat");

             $data = array(
             'name'        => 'dog',
             'id'          => 'dog',
             'value'       => 'accept',
             'checked'     => FALSE,
             'style'       => 'margin:10px',
             );
             echo form_checkbox($data);
             echo form_label("Dog<br>","dog");

             $data = array(
             'name'        => 'parrot',
             'id'          => 'parrot',
             'value'       => 'accept',
             'checked'     => FALSE,
             'style'       => 'margin:10px',
             );
             echo form_checkbox($data);
             echo form_label("Parrot<br>","parrot");



Codeigniter form checkbox group validation without using jquery or javascript - El Forum - 02-23-2014

[eluser]CroNiX[/eluser]
http://ellislab.com/codeigniter/user-guide/libraries/form_validation.html