mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-12 08:38:11 +00:00
multi select plug in double quoted string no value issue fixed
This commit is contained in:
parent
e68d8bf088
commit
747cad020f
@ -112,14 +112,25 @@ jsPsych.plugins['survey-multi-select'] = (function() {
|
|||||||
display_element.querySelector(question_selector).innerHTML += '<div id="'+option_id_name+'" class="'+_join(plugin_id_name, 'option')+'"></div>';
|
display_element.querySelector(question_selector).innerHTML += '<div id="'+option_id_name+'" class="'+_join(plugin_id_name, 'option')+'"></div>';
|
||||||
|
|
||||||
// add label and question text
|
// add label and question text
|
||||||
var option_label = '<label class="' + plugin_id_name + '-text">' + trial.options[i][j] + '</label>';
|
var form = document.getElementById(option_id_name)
|
||||||
display_element.querySelector(option_id_selector).innerHTML += option_label;
|
|
||||||
|
|
||||||
// create radio button
|
|
||||||
var input_id_name = _join(plugin_id_name, 'response', i);
|
var input_id_name = _join(plugin_id_name, 'response', i);
|
||||||
display_element.querySelector(option_id_selector + " label").innerHTML =
|
var label = document.createElement('label');
|
||||||
'<input type="checkbox" name="' + input_id_name + '" value="' + trial.options[i][j] + '">' +
|
label.setAttribute('class', plugin_id_name+'-text');
|
||||||
display_element.querySelector(option_id_selector + " label").innerHTML;
|
label.innerHTML = trial.options[i][j];
|
||||||
|
label.setAttribute('for', input_id_name)
|
||||||
|
// var option_label = '<label class="' + plugin_id_name + '-text">' + trial.options[i][j] + '</label>';
|
||||||
|
// display_element.querySelector(option_id_selector).innerHTML += option_label;
|
||||||
|
// create checkboxes
|
||||||
|
var input = document.createElement('input');
|
||||||
|
input.setAttribute('type', "checkbox");
|
||||||
|
input.setAttribute('name', input_id_name);
|
||||||
|
input.setAttribute('value', trial.options[i][j])
|
||||||
|
form.appendChild(input);
|
||||||
|
form.appendChild(label)
|
||||||
|
// var input_id_name = _join(plugin_id_name, 'response', i);
|
||||||
|
// display_element.querySelector(option_id_selector + " label").innerHTML =
|
||||||
|
// '<input type="checkbox" name="' + input_id_name + '" value="' + trial.options[i][j] + '">' +
|
||||||
|
// display_element.querySelector(option_id_selector + " label").innerHTML;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// add submit button
|
// add submit button
|
||||||
|
Loading…
Reference in New Issue
Block a user