Quote:1) FormTools won't record more than one checked option in a checkbox field.
This usually indicates that the space allocated for the field in the database is too small. Go to your Edit Form -> Fields tab and check the field size for the checkbox field. It needs to be big enough to store the string values of ALL checkboxes, so increase it to something a little bigger.
Quote:2) FormTools wont' record more than one submission. And second submission replaces the data in the first sumission. The submission ID remains at "1".
Are you using an API form? This will happen if you don't clear the sessions on the "thankyou" page.
The way it works is that every time a user goes to your form, it reserves them a unique Submission ID. On the final "thankyou" page, you need to clear the sessions so that next time they go to the form, they'll get a new ID. Make sure you include the PHP at the top of your page that's mentioned here: http://docs.formtools.org/tutorials/api_...page=step2
Hope this helps. Let me know if you have any other questions!
Thanks so much for your reply. The code in the thankyou page was screwed up. My bad. Sorry, I should have looked there.
The problem with the checkbox field recording only one option still persists. I made the field "text-large". And I played with all the other settings one at a time without any result. Just won't record more than one.
No worries! And sorry - I should have glanced at your attached form. The problem is that in order to pass an array of values for a group of checkboxes, you need to tweak the checkbox name attributes from this:
Code:
<input type="checkbox" name="services" />
To this:
Code:
<input type="checkbox" name="services[]" />
That should fix it up! You only need to change that in your form - not within Form Tools.
Hmm... nothing changed in that aspect of the API since the very beginning, so I wouldn't recommend installing a previous version.
What you posted looks fine.
If the form doesn't *always* submit, it means that the POST request doesn't always contain a "Submit" key on your form. Are you sure you form submit button has a name="Submit" attribute? (case important!). If not, it may only work on some browsers.
Regarding your thankyou page - is it in the same folder on the same server?
I'm new here in FormTools website but I already used formtools before but now I needed to create my form with checkboxes (I never used it before) and I get the same error Dave got.
I don't know if you need more info but I'm kinda dumb trying to get it right. I already try it in different ways and I still get only one submission in checkboxes.
Can you help me?
Thank you so much
Best regards
Ana
(Oct 11th, 2011, 11:19 AM)Ben Wrote: Hey Dave,
No worries! And sorry - I should have glanced at your attached form. The problem is that in order to pass an array of values for a group of checkboxes, you need to tweak the checkbox name attributes from this:
Code:
<input type="checkbox" name="services" />
To this:
Code:
<input type="checkbox" name="services[]" />
That should fix it up! You only need to change that in your form - not within Form Tools.
Feb 3rd, 2012, 9:29 AM (This post was last modified: Feb 3rd, 2012, 9:51 AM by FriedGeek.)
I don't know where Ben is but I can answer that real quick. I looked at the source code of your form. All of your checkboxes have the same "name=agencias". Checkboxes are different than radio fields and need to have a different name for each one (at least in your case). Ex: Porto could have the name="porto", SJM could have the name="sjm" and so forth. Each name must be unique to each checkbox. You will need to set up fields in your database for each name that you create for each checkbox on your form.
The radio fields are fine because they're grouped where the output is based on a single choice from that group.
Maybe I'm doing something wrong but I still get an error.
I tried to do what you told me FriedGeek and I put each checkbox with a single name like you said for example, Porto now has the name=porto and so on. The group of checkboxes have the name of agencias[] and I put the brackets because I read Ben telling someone that.
Maybe my mistake is located on my database?
When I did the submission test I choose only one checkbox (do I need to select all?) than I update the database and added more line and gave them names like I have in my form. I laso had a list with options with all elements names already programmed and I used it (They are a group of options).