Jan 19th, 2011, 10:08 AM
I'm having problems with form tools pulling submissions of checkboxes. I've read several previous posts and tried, to no avail:
1) increasing the size of the database field, in case it was being clipped
3) adding names to all the boxes
2) a number of other possibilities
The weird thing too is, when I try to compare with the Petition demo on the Form Tools site, I make a submission, sign in to the demo form tools server, and the check boxes don't send the values in the demo either...
Right now, my code looks like what is pasted below. Any help would be most appreciated! Thank you.
<td width="215">Legislator/Legislative Staff Spouse or Guest</td>
<td width="125"><input type="checkbox" name="registrants[]" value="Legislator/Legislative Staff Spouse or Guest"
<?php if (@$fields["registrants[]"] == "Legislators and Legislative Staff") echo "checked"; ?> />
No Fee</td>
<td width="125" bgcolor="#FFFFFF">No Fee</td>
</tr>
<tr>
<td colspan="2">Other State Government Official</td>
<td><input type="checkbox" name="registrants[]" value="Other State Government Official"
<?php if (@$fields["registrants[]"] == "Other State Government Official") echo "checked"; ?> />
$375</td>
<td bgcolor="#FFFFFF">$425</td>
</tr>
<tr>
<td> </td>
<td>Other State Government Official Spouse or Guest *</td>
<td><input type="checkbox" name="registrants[]" value="Other State Government Official Spouse or Guest *"
<?php if (@$fields["registrants[]"] == "Other State Government Official Spouse or Guest *") echo "checked"; ?> />
$50</td>
<td bgcolor="#FFFFFF">$100</td>
</tr>
I've also tried an exact copy of the petition demo, but that doesn't work either:
<table border="0" cellpadding="2" cellspacing="0" class="bottom">
<tr>
<td colspan="2"></td>
<td><strong>On or Before ____________ Registration Fee</strong></td>
<td bgcolor="#FFFFFF"><strong>After ____________ Registration Fee</strong></td>
</tr>
<tr>
<td colspan="2">Legislators and Legislative Staff</td>
<td><input type="checkbox" name="registrants[]" id="registrant1" value="Legislators and Legislative Staff"
<?php if (isset($fields["registrants"]) && is_array($fields["registrants"]) && in_array("Legislators and Legislative Staff", $fields["registrants"])) echo "checked"; ?> />
<label for="registrant1">$300</label></td>
<td bgcolor="#FFFFFF">$350</td>
</tr>
<tr>
<td width="25"></td>
<td width="215">Legislator/Legislative Staff Spouse or Guest</td>
<td width="125"><input type="checkbox" name="registrants[]" id="registrant2" value="Legislator/Legislative Staff Spouse or Guest"
<?php if (isset($fields["registrants"]) && is_array($fields["registrants"]) && in_array("Legislator/Legislative Staff Spouse or Guest", $fields["registrants"])) echo "checked"; ?> />
<label for="registrant2">No Fee</label></td>
<td width="125" bgcolor="#FFFFFF">No Fee</td>
</tr>
<tr>
<td colspan="2">Other State Government Official</td>
<td><input type="checkbox" name="registrants[]" id="registrant3" value="Other State Government Official"
<?php if (isset($fields["registrants"]) && is_array($fields["registrants"]) && in_array("Other State Government Official", $fields["registrants"])) echo "checked"; ?> />
<label for="registrant3">$375</label></td>
<td bgcolor="#FFFFFF">$425</td>
</tr>
<tr>
<td> </td>
<td>Other State Government Official Spouse or Guest *</td>
<td><input type="checkbox" name="registrants[]" id="registrant4" value="Other State Government Official Spouse or Guest *"
<?php if (isset($fields["registrants"]) && is_array($fields["registrants"]) && in_array("Other State Government Official Spouse or Guest *", $fields["registrants"])) echo "checked"; ?> />
<label for="registrant4">$50</label></td>
<td bgcolor="#FFFFFF">$100</td>
</tr>
<tr>
<td colspan="2">Private Sector/All Others</td>
<td><input type="checkbox" name="registrants[]" id="registrant5" value="Private Sector/All Others"
<?php if (isset($fields["registrants"]) && is_array($fields["registrants"]) && in_array("Private Sector/All Others", $fields["registrants"])) echo "checked"; ?> />
<label for="registrant5">$500</label></td>
<td bgcolor="#FFFFFF">$550</td>
</tr>
<tr>
<td> </td>
1) increasing the size of the database field, in case it was being clipped
3) adding names to all the boxes
2) a number of other possibilities
The weird thing too is, when I try to compare with the Petition demo on the Form Tools site, I make a submission, sign in to the demo form tools server, and the check boxes don't send the values in the demo either...
Right now, my code looks like what is pasted below. Any help would be most appreciated! Thank you.
<td width="215">Legislator/Legislative Staff Spouse or Guest</td>
<td width="125"><input type="checkbox" name="registrants[]" value="Legislator/Legislative Staff Spouse or Guest"
<?php if (@$fields["registrants[]"] == "Legislators and Legislative Staff") echo "checked"; ?> />
No Fee</td>
<td width="125" bgcolor="#FFFFFF">No Fee</td>
</tr>
<tr>
<td colspan="2">Other State Government Official</td>
<td><input type="checkbox" name="registrants[]" value="Other State Government Official"
<?php if (@$fields["registrants[]"] == "Other State Government Official") echo "checked"; ?> />
$375</td>
<td bgcolor="#FFFFFF">$425</td>
</tr>
<tr>
<td> </td>
<td>Other State Government Official Spouse or Guest *</td>
<td><input type="checkbox" name="registrants[]" value="Other State Government Official Spouse or Guest *"
<?php if (@$fields["registrants[]"] == "Other State Government Official Spouse or Guest *") echo "checked"; ?> />
$50</td>
<td bgcolor="#FFFFFF">$100</td>
</tr>
I've also tried an exact copy of the petition demo, but that doesn't work either:
<table border="0" cellpadding="2" cellspacing="0" class="bottom">
<tr>
<td colspan="2"></td>
<td><strong>On or Before ____________ Registration Fee</strong></td>
<td bgcolor="#FFFFFF"><strong>After ____________ Registration Fee</strong></td>
</tr>
<tr>
<td colspan="2">Legislators and Legislative Staff</td>
<td><input type="checkbox" name="registrants[]" id="registrant1" value="Legislators and Legislative Staff"
<?php if (isset($fields["registrants"]) && is_array($fields["registrants"]) && in_array("Legislators and Legislative Staff", $fields["registrants"])) echo "checked"; ?> />
<label for="registrant1">$300</label></td>
<td bgcolor="#FFFFFF">$350</td>
</tr>
<tr>
<td width="25"></td>
<td width="215">Legislator/Legislative Staff Spouse or Guest</td>
<td width="125"><input type="checkbox" name="registrants[]" id="registrant2" value="Legislator/Legislative Staff Spouse or Guest"
<?php if (isset($fields["registrants"]) && is_array($fields["registrants"]) && in_array("Legislator/Legislative Staff Spouse or Guest", $fields["registrants"])) echo "checked"; ?> />
<label for="registrant2">No Fee</label></td>
<td width="125" bgcolor="#FFFFFF">No Fee</td>
</tr>
<tr>
<td colspan="2">Other State Government Official</td>
<td><input type="checkbox" name="registrants[]" id="registrant3" value="Other State Government Official"
<?php if (isset($fields["registrants"]) && is_array($fields["registrants"]) && in_array("Other State Government Official", $fields["registrants"])) echo "checked"; ?> />
<label for="registrant3">$375</label></td>
<td bgcolor="#FFFFFF">$425</td>
</tr>
<tr>
<td> </td>
<td>Other State Government Official Spouse or Guest *</td>
<td><input type="checkbox" name="registrants[]" id="registrant4" value="Other State Government Official Spouse or Guest *"
<?php if (isset($fields["registrants"]) && is_array($fields["registrants"]) && in_array("Other State Government Official Spouse or Guest *", $fields["registrants"])) echo "checked"; ?> />
<label for="registrant4">$50</label></td>
<td bgcolor="#FFFFFF">$100</td>
</tr>
<tr>
<td colspan="2">Private Sector/All Others</td>
<td><input type="checkbox" name="registrants[]" id="registrant5" value="Private Sector/All Others"
<?php if (isset($fields["registrants"]) && is_array($fields["registrants"]) && in_array("Private Sector/All Others", $fields["registrants"])) echo "checked"; ?> />
<label for="registrant5">$500</label></td>
<td bgcolor="#FFFFFF">$550</td>
</tr>
<tr>
<td> </td>