misc: limit checkbox js prefill to single checkbox field (#58422)

This commit is contained in:
Frédéric Péters 2021-11-05 14:52:57 +01:00
parent 21d0034fe3
commit 5071ecdfac
1 changed files with 4 additions and 2 deletions

View File

@ -480,8 +480,10 @@ $(function() {
if ($(widget).is('.widget-prefilled') || $(widget).is('.widget-readonly') || data.modified_field == 'user') {
// replace text input value
$(widget).find('input[type=text], input[type=tel], input[type=numeric], input[type=email], input[type=date], textarea').val(value.content);
// replace checkbox input value
$(widget).find('input[type=checkbox]').prop('checked', value.content);
if ($widget.hasClass('CheckboxWidget')) {
// replace checkbox input value
$widget.find('input[type=checkbox]').prop('checked', value.content);
}
}
}
});