[eluser]Unknown[/eluser]
Hi, I'm fairly new to CodeIgniter and I'm having an issue with the form validation library. What I'm trying to accomplish is, There are 10 types of Electronic Gadgets and a user is allowed to select minimum of 1 and a maximum of 4. These are checkboxes. In native PHP I could simply do this by
Code:
$selected_items_count = $_POST['gadget'];
if ( count( $selected_items_count) >= 1 && count( $selected_items_count) <= 4 ) {
....
}
But then again, I'm using CodeIgniter

I want to use the form validation library to accomplish this. I tried creating a callback function but each element in the $_POST["gadget"] is getting passed to it separately and not as the array itself. Can someone kindly help me out !
Thanks a lot in advance.