Checkbox validation
-
Hey guys,
I have a list of checkboxes and am wanting to build in some kind of loop so I don’t have to list every single checkbox. Currently I just have 2 to test with:
// Sanitize and validate input. Accepts an array, return a sanitized array. function lc_options_validate($input) { // Our first value is either 0 or 1 $input['option1'] = ( isset($input['option1']) == 1 ? 1 : 0 ); $input['option2'] = ( isset($input['option2']) == 1 ? 1 : 0 ); return $input; }
I am drawing a blank, any ideas on how I can have this loop?
Thanks!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Checkbox validation’ is closed to new replies.