| The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.33 (Linux)
|
![]() |
|
Field with checkboxes only saves one choice - 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: Field with checkboxes only saves one choice (/showthread.php?tid=919) |
Field with checkboxes only saves one choice - mrGarvin - Nov 3rd, 2010 Hi. I've stumbled upon a strange problem. My latest form has three fields with checkboxes where the user can make multiple choices. For some reason the third one won't work at all. Only one choice is registered. It is the same in the admin interface. If I try to tick more than one option only one is saved on edit. All three are made the same way, (and Yes, I use square brackets []). All three makes use of field option groups made the same way, and all three database fields look the same when i study them in the admin interface and through PHPmyAdmin. I tried to delete the database field and the field option group and made new ones, but the same result. Any idea on what I should look for more? Here are some screen shots to show you. [attachment=81] This is the database for the three fields with checkboxes [attachment=85] Here are the three fields. Pass1 and pass2 works.(I have a different name on the third because I made a new one. It had the same name structure before, but didn't work then either) [attachment=82] This is one field that works [attachment=83] This is the one that doesn't work [attachment=84] This it the field group that is used by the one that doesn't work. It looks the same as the others. And the HTML behind it all: One that works (extract from it) PHP Code: <label>PHP Code: <label>RE: Field with checkboxes only saves one choice - Ben - Nov 4th, 2010 Hi MrGarvin, Sounds like maybe the database field size is too small. Go to your Edit Form -> Database tab and make sure it's at least 256 chars for that field. MySQL is very forgiving in this regard: if values being inserted into a field are too big for the field, it just truncates it. So what's probably happening is that the last field is being truncated, which prevents it from appearing as checked in the FT interface. Hope this helps! - Ben RE: Field with checkboxes only saves one choice - mrGarvin - Nov 8th, 2010 Ach so... It worked! Thanks Ben! I didn't realise that the string will in fact consist of more than 5 integers when I use multi-choice. Silly mistake! You made my day (as always :-) ) |