The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
|
Checkbox not reporting all selections - 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: Checkbox not reporting all selections (/showthread.php?tid=4678) |
Checkbox not reporting all selections - bojacks - Oct 2nd, 2014 I have FT 2.2.6 with an API external form. I have two checkbox fields. One has 8 items and the other has 6. Users can select one or multiple items in each of the fields with the checkbox. My problem is Formtool only post one item when multiple items are checked and its always the last item checked. All the other fields post to the database and email properly but I just get the last checkbox item no matter how many are selected. I'd appreciate any help. Thanks, RE: Checkbox not reporting all selections - cbscreative - Nov 25th, 2016 Definitely late for the OP but I had this same issue with an external form and was able to resolve it. The problem arises because the PHP is correctly calling an array to pass on during processing but the FT interface offers no mechanism to create the array. Maybe that sounds too technical but the solution is easy once the maddening process of finding it is achieved. In your form HTML simply add empty brackets to the end of your name attribute in your checkbox input tag. Example: <input type="checkbox" name="examplename[]" value="examplevalue"> This ought to greatly help anyone who finds this thread when they encounter this same issue and need a solution. |