- lasercorpAsked on June 03, 2017 at 11:18 AM
I am posting a multiple choice question that is a required field to a mysql db.
The issue is that if the user chooses option 1 & 3, the answer for option 3 gets inserted into array  instead of 
as follows ;
$campsession1 = $_POST['campsessions']['0'];
$campsession2 = $_POST['campsessions']['1'];
$campsession3 = $_POST['campsessions']['2'];
but is they select all three options or just the first option , the data gets posted correctly.
- JotForm SupportNik_CAnswered on June 03, 2017 at 02:53 PM
I tested the form and I saw what you're referring to and I assume that this issue is related to indexes of the checkbox fields.
Since whatever is chosen as second, will be with the second index, I found this thread from one of my colleagues, where this issue was discussed and resolved:
If you still have this issue please let us know.
- lasercorpAnswered on June 04, 2017 at 12:28 PM
the posted solution does not address the issue but only suggests concatenating the three answers into one field with a comma separator.
A multiple choice answer should be able to be entered into the appropriate array field
It seems like a bug in the code. Can this be escalated and resolved?
- JotForm SupportjonathanAnswered on June 04, 2017 at 02:52 PM
I was able to reproduced the glitch as well. The posted data have a wrong index number in the array when using fields that allows multiple choices.
It can be tested using the test post data URL https://www.jotform.com/show-post-data/
The glitch can result to wrong data collection.
I have elevated this thread now to the higher team support so that they can check and apply the needed fix.
We will notify you here once we have new updates on the status.
- lasercorpAnswered on June 21, 2017 at 09:38 PM
Hi, Any update on this fix?
- JotForm SupportChriistianAnswered on June 21, 2017 at 11:21 PM
There is no update yet regarding this issue. Rest assured you will be informed in this thread if there are any updates on this fix.
- JotForm SupportNeilVicenteAnswered on June 22, 2017 at 05:08 PM
Post data for check box fields works as designed. We consider unselected check box fields as empty, so we only collect those that are checked.
Can you tell us how exactly you intend to use these values on your script?
We would love to help with a workaround, if possible.