我想当我从组合框中选择一个值时,它会显示特殊表,当我选择另一个值时,它会显示另一个表,但我的代码无法正常工作。
<script>
function bank_state() {
if (document.profile.nb_shetab_bank.value == 'SAMAN') {
document.getElementById('auth_method_pr1').style.display = 'inline';
document.getElementById('auth_method_pr2').style.display = 'none';
} else if (document.profile.nb_shetab_bank.value == 'MELAT') {
document.getElementById('auth_method_pr1').style.display = 'none';
document.getElementById('auth_method_pr2').style.display = 'inline';
}
}
</script>
<select name="nb_shetab_bank" size="1" onchange="bank_state();" >
<option value="SAMAN" selected>Saman</option>
<option value="MELAT" >Mellat</option>
</select>
<table border="1" cellpadding="0" cellspacing="0" id="auth_method_pr1"
style="display:none;">
<tr><td>salam</td></tr>
</table>
<table width="100%" border="1" cellpadding="0" cellspacing="0" id="auth_method_pr2"
style="display:none;">
style="display:none;">
<tr><td>salam salam</td></tr>
</table>