fix checkbox labels when removing their optional fields

This commit is contained in:
Jakob Ketterl 2021-04-29 15:34:46 +02:00
parent 29bce9e07a
commit 7642341b2e

View File

@ -19,7 +19,7 @@ $.fn.optionalSection = function(){
var group = $(e.target).parents('.form-group') var group = $(e.target).parents('.form-group')
group.find('input, select').prop('disabled', true); group.find('input, select').prop('disabled', true);
$optionalInputs.append(group); $optionalInputs.append(group);
var $label = group.find('> label'); var $label = group.find('label');
var $option = $('<option value="' + group.data('field') + '">' + $label.text() + '</option>'); var $option = $('<option value="' + group.data('field') + '">' + $label.text() + '</option>');
$select.append($option); $select.append($option);