Hello,
I'm using select2 to display answer choices for a multi select question. The list of possible answers is contained in a local JavaScript array and is quite large (nearly 700 unique choices). The choices render and selected without issues. However, when a user submits the survey, the answers they selected are not saved, and the corresponding field is blank. I have several ideas, including piping the selections to a dummy question as a free text response, but I'm not sure how to implement this. Would appreciate any suggestions!
Solved
Passing/retrieving responses from select2 to backend
Best answer by TomG
realdat needs to be an array and you need to move setEmbeddedData outside the array and convert the realdat array to comma separated string using .join().
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.