The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
|
problems with checkbox submissions - Printable Version +- Form Tools (https://forums.formtools.org) +-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1) +--- Forum: General Discussion (https://forums.formtools.org/forumdisplay.php?fid=5) +--- Thread: problems with checkbox submissions (/showthread.php?tid=1036) |
problems with checkbox submissions - mikkolindberg - Jan 19th, 2011 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> RE: problems with checkbox submissions - Ben - Jan 19th, 2011 Hi Mikko, Sorry you're having trouble! Sounds like you've been pretty thorough though. If the petition form isn't working either, chances are it's just misconfigured in the Form Tools UI. Log in, edit the form and go to the Fields tab. There, check the field name: check it's "registrants" and not "registrants[]" or anything else. Also check there's no whitespace at the end. I think the system automatically removes it, but just in case... The other possibility is: check your form to make sure there isn't another fields with the name "registrants" anywhere else besides the checkboxes. That would also cause problems. Let me know if you still have no luck. - Ben RE: problems with checkbox submissions - mikkolindberg - Jan 20th, 2011 Thank you Ben for helping with this. I tried the three things you mentioned (check field name for white space, make sure it's lower case and "registrants", and checked for other fields with "registrants", none exist), but didn't have any luck with them. I may have misunderstood some of your instructions. I went to the petition form demo hosted on the formtools site, but didn't have access to change anything there. Again I noticed a weird thing. There had been other test submission in addition to mine, and the petition demo had indeed pulled the info pushed by the checkboxes from the demo. However, when the submission came from my I.P. address, the system yet again did not recognize that I had checked any boxes. Anyway, after I realized you were talking about my "petition", I went and tried the fixes on our site, but no dice. Sorry. RE: problems with checkbox submissions - Ben - Jan 20th, 2011 Huh! This is one of those situations which is an absolute devil to debug without seeing it first-hand. Could you post a link to your form (or email it to me privately at ben.keen@gmail.com if you don't want it public)? I'd like to look at that to see if I can see anything wonky. If that looks okay, we'll take a closer look at your Form Tools configuration. - Ben RE: problems with checkbox submissions - mikkolindberg - Jan 21st, 2011 Thanks Ben. I sent you an email with links to the test pages I'm working on. When this is all resolved maybe we can post the solution for people that might be experiencing a similar issue? RE: problems with checkbox submissions - Ben - Feb 9th, 2011 Hi all, Just to close this thread: it turned out that the problem was with the Petition form (now since fixed in the downloadable version). Thanks again, Mikko. - Ben RE: problems with checkbox submissions - nevada - Apr 10th, 2011 I'm having problems with this one which none of the solutions here seem to have solved. I'm still testing with the forms provided in your demo, so there's been no customization, but if I select one checkbox, I can view this via submissions; however, multiple checks do not appear (except on my DB itself, where the entries can be clearly seen). If I manually edit the submission & check a few boxes, then this also displays fine - so what could it possibly be? |