attempt #2
This commit is contained in:
@@ -288,7 +288,23 @@ function Build-Checkboxes {
|
||||
<div id='${($_.Id)}OptionsContainer' style='display:none; margin-top:4px;'>
|
||||
$subHtml
|
||||
</div>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
const masterCheckbox = document.getElementById('${($_.Id)}');
|
||||
const container = document.getElementById('${($_.Id)}OptionsContainer');
|
||||
if (masterCheckbox && container) {
|
||||
masterCheckbox.addEventListener('change', function () {
|
||||
container.style.display = this.checked ? 'block' : 'none';
|
||||
});
|
||||
// Auto-show if already checked (e.g. page reload with checkbox checked)
|
||||
if (masterCheckbox.checked) {
|
||||
container.style.display = 'block';
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
"@
|
||||
|
||||
}
|
||||
|
||||
$html
|
||||
|
||||
Reference in New Issue
Block a user