Hi i have a form featuring 2 images as input types (buy and requote). When you enter the page requote is disabled and greyed out (switched off) and i have a checkbox that switches the buy button off (i.e. disables it and displays a greyed out version of it) and enables requote. When the checkbox is unchecked it should switch back again to its original state.
Here is my function
- Code: Select all
<script type="text/javascript">
function excludeMedCon()
{
document.getElementById("buy").disabled='true'
document.getElementById("requote").disabled='false'
document.getElementById("buy").src="images/buy_now_disabled.gif"
document.getElementById("requote").src="images/button_requote.gif"
}
function noexcludeMedCon()
{
document.getElementById("requote").disabled='true'
document.getElementById("buy").disabled='false'
document.getElementById("buy").src="images/buy_now.gif"
document.getElementById("requote").src="images/button_requote_disabled.gif"
}
</script>
Here is the code that calls the function from the checkbox being clicked:
- Code: Select all
onClick="if (this.checked) { excludeMedCon() } else { noexcludeMedCon() }"
My images are switching fine and the buttons are being disabled fine, but they are not being re-enabled. I though the syntax to re-enable a disabled form item was just
disabled='false' but obviosuly i am wrong. Any ideas as i am stumped?
Thanks in advance.