I have a problem repopulating a set of checkboxes after an unsuccessful form validation returns the user back to the same form. Dropdown menus and text inputs could be repopulat
function set_checkbox_array($field, $value) { $arr = isset($_POST[$field]) ? $_POST[$field] : FALSE; return ($arr !== FALSE && is_array($arr) && in_array($value, $arr)) ? 'checked="checked"' : ''; }