forked from beba/foerderbarometer
WM-12: hide other value row when not checked
This commit is contained in:
parent
714d249608
commit
638f6cd5ed
|
|
@ -6,6 +6,7 @@
|
|||
const otherInput = $(otherInputSelector);
|
||||
const otherLabelSelector = 'label'.concat('[for="', this.id, '_other"]');
|
||||
const otherLabel = $(otherLabelSelector);
|
||||
const otherTableRow = otherInput.parents('tr');
|
||||
|
||||
const toggle = function () {
|
||||
const checked = otherCheckbox.prop('checked');
|
||||
|
|
@ -13,7 +14,7 @@
|
|||
otherInput.prop('disabled', !checked);
|
||||
otherInput.prop('required', checked);
|
||||
otherLabel.toggleClass('required', checked);
|
||||
otherLabel.css('opacity', checked ? 1 : 0.3);
|
||||
otherTableRow.css('visibility', checked ? 'visible' : 'collapse');
|
||||
|
||||
if (checked) {
|
||||
otherInput.focus();
|
||||
|
|
|
|||
Loading…
Reference in New Issue