-
Hi, I am using the survey-html-form and I noticed that whenever I check more than one option in multiple choice only the last value is registered. The code is: var Sprachkentnisse2 = {
type: 'survey-html-form',
preamble: '<h2>Language learning</h2>' +
'<div class="myDiv"><p>Please answer the following question:</p></div>',
html: 'How did you learn German? (You may choose several options) <br><input name="LearnType" type= "checkbox" id="course" value="course"> <label for="course">I took a course</label><br><input name="LearnType" type= "checkbox" id="selftaught" value="selftaught"> <label for="selftaught">Self-taught</label><br><input name="LearnType" type= "checkbox" id="immersion" value="immersion"> <label for="immersion">I lived in a German-speaking country</label><br>',
button_label: 'OK',
on_finish: function() {
var curr_progress_bar_value = jsPsych.getProgressBarCompleted();
jsPsych.setProgressBar(curr_progress_bar_value + (1/n_screens));
}
}; So for instance, if I check all three, only "immersion" shows in the database. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I found the problem. Normally each one of the name="" attributes should be exactly the same, but if I do that then the others overwrite, so instead of name="LearnType" in all three options I had to type name="LearnType1" for option 1, etc. |
Beta Was this translation helpful? Give feedback.
I found the problem. Normally each one of the name="" attributes should be exactly the same, but if I do that then the others overwrite, so instead of name="LearnType" in all three options I had to type name="LearnType1" for option 1, etc.