I have a checkbox array that returns values correctly in development but not in production. In production, it returns an array with the number of elements corresponding to the number of elements that were checked, but the value on each is empty. In development I get the string(s) that are assigned to the value of the checkboxes (the ones that have been checked). Here's the relevant html:
<ul>
<li><input type="checkbox" name="ckRole[]" value="Fisherman" /> Fisherman</li>
<li><input type="checkbox" name="ckRole[]" value="Seafood Supplier" /> Seafood Supplier </li>
<li><input type="checkbox" name="ckRole[]" value="Industry Representative" /> Industry Representative</li>
<li><input type="checkbox" name="ckRole[]" value="Regulator-Elected Official" /> Regulator/Elected Official</li>
<li><input type="checkbox" name="ckOther" value="Other" /> Other (explain) <input type="textbox" name="txtOther" id="txtOther" /></li>
</ul>
And the code:
$contact->profession = "";
if(isset($_POST['ckRole'])) {
// echo ("<pre>" . print_r($_POST['ckRole']) . "</pre>");
$contact->profession = implode("|", $_POST['ckRole']);
}
if(isset($_POST['txtOther']) && (!empty($_POST['txtOther']))) {
$contact->profession .= ((empty($contact->profession) ? '' : '|') . 'Other (' . $_POST['txtOther'] . ')');
}
Can't figure out why it works on my test machine but not production. I saw one post that said to add enctype="multipart/form-data" to the form tag, but that didn't help.