I'm trying to show and hide DIVs based on the onSelect event handler, but it's not working.
This is my javascript:
function showDiv(divID) {
document.getElementById(divID).style.display = 'block';
}
And this is my HTML:
Type of payment account:
<select name="paymentAccountType" onchange="showDiv(this);" >
<option></option>
<option>Credit card</option>
<option>Debit card</option>
<option>EFT</option>
</select>
<div id="EFT" style="display:none;">EFT</div>
<div id="credit" style="display:none;">Credit card</div>
<div id="debit" style="display:none;">Debit card</div>
mariita
Asked:
Change your select box to this:
Type of payment account:
<select name="paymentAccountType" onchange="showDiv(this.val
<option></option>
<option value="credit">Credit card</option>
<option value="debit">Debit card</option>
<option value="eft">EFT</option>
</select>
That should work!
Let me know if you need anything else
Richard