Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

Red Deer Web Design on "Checkbox validation"

$
0
0

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 all articles
Browse latest Browse all 8245

Trending Articles