jowd
01-13-2005, 04:01 AM
Hi All,
I think I'm going crazy over this... I've spent many hours now trying to figure it out.
Here's the goal:
I want to force the acknowledgement of a legal statement by
disabling the submit button on a form until the user has checked
a box. When the checkbox has been checked then the submit
button becomes enabled allowing the user to submit the form.
Problem:
When you try to click on the checkbox the following error is generated:
Error: Object doesn’t support this property or method
Here’s the code (not working):
<HTML>
<HEAD>
</HEAD>
<BODY>
<form action="processform.php" method="post" name="cngcc" id="">
<input type="checkbox" name="acknowledgeITADA" value="yes"
onClick="javascript:enableDisable()">Acknowledged.<br>
<input type="image" name="submit" alt="submit" border="0"
src="_art/BoxOrderSearch.gif" disabled="disabled" ><br>
</FORM>
<script language="JavaScript">
<!--
function enableDisable() {
if (document.cngcc.acknowledgeITADA.checked)
{
document.cngcc.submit.disabled = false;
}
else
{
document.cngcc.submit.disabled = true;
}
}
//-->
</script>
</BODY>
</HTML>
Notes Worth Mentioning:
This code works perfectly if the button is set to type=”submit” (but of course then it’s not a graphical button).
Also, if you change the name from “submit” to “search” or something else then it generates a different error:
Error: ‘document.cngcc.search’ is null or not an object
Thanks in advance for any help... you guys are the best!
-- Jonathan
I think I'm going crazy over this... I've spent many hours now trying to figure it out.
Here's the goal:
I want to force the acknowledgement of a legal statement by
disabling the submit button on a form until the user has checked
a box. When the checkbox has been checked then the submit
button becomes enabled allowing the user to submit the form.
Problem:
When you try to click on the checkbox the following error is generated:
Error: Object doesn’t support this property or method
Here’s the code (not working):
<HTML>
<HEAD>
</HEAD>
<BODY>
<form action="processform.php" method="post" name="cngcc" id="">
<input type="checkbox" name="acknowledgeITADA" value="yes"
onClick="javascript:enableDisable()">Acknowledged.<br>
<input type="image" name="submit" alt="submit" border="0"
src="_art/BoxOrderSearch.gif" disabled="disabled" ><br>
</FORM>
<script language="JavaScript">
<!--
function enableDisable() {
if (document.cngcc.acknowledgeITADA.checked)
{
document.cngcc.submit.disabled = false;
}
else
{
document.cngcc.submit.disabled = true;
}
}
//-->
</script>
</BODY>
</HTML>
Notes Worth Mentioning:
This code works perfectly if the button is set to type=”submit” (but of course then it’s not a graphical button).
Also, if you change the name from “submit” to “search” or something else then it generates a different error:
Error: ‘document.cngcc.search’ is null or not an object
Thanks in advance for any help... you guys are the best!
-- Jonathan
