Skip to content

Commit f9f76a8

Browse files
committed
fix copy from previous for multi selects
1 parent cbf2f23 commit f9f76a8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

crowdsourcer/templates/crowdsourcer/authority_questions_with_previous.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,8 @@ <h3 class="h5 text-muted mb-3 mb-lg-4">New response</h3>
195195
*/
196196
if(previous_responses.multi_option){
197197
new_responses.querySelectorAll('[name$="multi_option"]').forEach(function(checkbox){
198-
checkbox.checked = ( previous_responses.multi_option.indexOf(checkbox.label) > -1 );
198+
let label_text = $('label[for=' + checkbox.id + ']').text();
199+
checkbox.checked = ( previous_responses.multi_option.indexOf(label_text) > -1 );
199200
});
200201
} else {
201202
new_responses.querySelectorAll('[name$="option"] option').forEach(function(option){

0 commit comments

Comments
 (0)