I am having trouble figuring out the proper use of isSelected when it comes to checkboxes. Basically I want to find out if a checkbox has been selected. With the function below I am able to get the text, but I just can't seem to figure out how to detect if it is checked.
add_action("gform_pre_submission_1", "pre_submission_handler");
function pre_submission_handler($form){
$industry = "";
foreach($form['fields'] as &$field){
if ($field['type'] == 'checkbox') {
foreach($field['choices'] as $choice) {
$industry .= $choice["text"] . ",";
$industry .= $choice["isSelected"] . ",";
}
}
}
$_POST["input_18"] = $industry;
}