I'm trying to put together a webpage that will leave a dropdown menu (near merch1) disabled until the checkbox is selected, but the dropdown menu insists on staying disabled. I don't know if it has to do with my checkBox function, or if that's even a necessity. Here is a small excerpt of my code.
/* <![CDATA[ */
var cart1 = 0;
function checkBox(name)
{
document.getElementById(name).enabled = !document.getElementById(name).enabled;
}
function calcTotal
{
var sheet1 = parseInt(document.buy.merch1.value);
if (document.buy.MusicSheet1.checked)
{
document.buy.merch1.disabled = false;
cart1 = (sheet1 * 4.95);
}
else
{
document.buy.merch1.disabled = true;
cart1 = 0;
}
}
/* ]]> */
<form id="buyForm" name="buy">
<tr>
<td>
<input type="checkbox" name="MusicSheet1" onchange="checkBox('one')" /> We Will All Go Together sheet music, $4.95
</td>
<td>
<select name="merch1" id="one" onchange="calcTotal()" disabled="disabled">
<option value="0" selected="selected"></option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option></select>
</td>
</tr>
</form>