javascriptで複数のhtml要素を有効/無効にするコードをいくつか経験しました:
<script type="text/javascript">
function enableDisable(bEnable, text_no1, text_no2, opt_no1, opt_no2){
document.getElementById(text_no1).disabled = !bEnable
document.getElementById(text_no2).disabled = !bEnable
document.getElementById(opt_no1).disabled = !bEnable
document.getElementById(opt_no2).disabled = !bEnable
}
</script>
<label for="toggler"><input type="checkbox" id="toggler" autocomplete="off"
checked="false"
onclick="enableDisable(this.checked, 'text_no1','text_no2','opt_no1','opt_no2')";>
Toggler</label>
<br>
<input type="text" name="text_no1"><br>
<input type="text" name="text_no1"><br>
<select name="opt_no1">
<option>1</option>
</select>
<select name="opt_no2">
<option>1</option>
</select>