checkbox validation help needed |
[eluser]Computerzworld[/eluser]
Hello. I am having 7 checkboxes with 7 different names. I want that atleast one checkbox should be checked using CI validation. How can I do it? Plz help me. Thanks in advance.
[eluser]MASS MASS[/eluser]
you do like this....... <input type="checkbox" name="chked[]" value = "1"> <input type="checkbox" name="chked[]" value = "2"> in validation $rules['chked'] = "required" and $field['chked'] = "Check field"
[eluser]Dan Murfitt[/eluser]
Thanks for posting this, it seems to work well. How would you reference the default value with this? For example: Code: echo $this->validation->set_checkbox('chked[]', '1') Thanks for your help. Dan
[eluser]Dan Murfitt[/eluser]
[quote author="Dan Murfitt" date="1218742890"]Thanks for posting this, it seems to work well. How would you reference the default value with this? For example: Code: echo $this->validation->set_checkbox('chked[]', '1') Thanks for your help. Dan[/quote] Just found a thread with a working solution to this... http://ellislab.com/forums/viewthread/73012/ Thanks |
Welcome Guest, Not a member yet? Register Sign In |