If you're looking to dynamically change content based on a dropdown selection, the onchange event is your go-to. Here's an example:
<select id="standardSelectId" onchange="fillSection(this)">...</select>
<select id="sectionSelectId" onchange="fillSubject(this)"><option>-- Select Standard first --</option></select>
<select id="subjectSelectId"><option>-- Select Section first --</option></select>
Next, create a JavaScript function to populate the subsequent select with options and reset any dependent selects:
<script type="text/javascript">
function fillSection(e) {
var choice = e.options[e.selectedIndex];
var sectionSelect = document.getElementById("sectionSelectId");
var subjectSelect = document.getElementById("subjectSelectId");
subjectSelect.options.length = 0;
try { subjectSelect.add(new Option("-- Select Section first --", ""))} catch(ex) {subjectSelect.add(new Option("-- Select Section first --", ""), null)}
sectionSelect.options.length = 0;
switch (choice.value) {
case <standard val1>:
try { sectionSelect.add(new Option(section1_label_1, section1_key_1))} catch(ex) {subjectSelect.add(new Option(section1_label_1, section1_key_1), null)}
...
try { sectionSelect.add(new Option(section1_label_N, section1_key_N))} catch(ex) {subjectSelect.add(new Option(section1_label_N, section1_key_N), null)}
break;
case <standard valX>:
try { sectionSelect.add(new Option(sectionX_label_1, sectionX_key_1))} catch(ex) {subjectSelect.add(new Option(sectionX_label_1, sectionX_key_1), null)}
...
try { sectionSelect.add(new Option(sectionX_label_N, sectionX_key_N))} catch(ex) {subjectSelect.add(new Option(sectionX_label_N, sectionX_key_N), null)}
break;
}
function fillSubject(e) {
...
}