stevefNYC
asked on
JavaScript onclick inquiry
I have a form with a checkbox that must be clicked before the form can be processed. My code for the checkbox looks like this:
<input type="checkbox" name="iagree" id="iagree" onclick="clickIagree()"> I agree
and clickIagree() looks like this:
function clickIagree() {
if (document.signupform.iagre e.checked= =true) {
document.signupform.signup .disabled = false;
} else {
document.signupform.signup .disabled = true;
}
}
My error debug message is saying document.signupform.signup has no properties. Although I do have a signup form:
<form name="signupform" method="POST" action="thank_you.php" >
Perhaps it is my input image?
<input type="image" src="img/push-signup-small .png" style="margin: 0; padding: 0; cursor: pointer;" disabled onclick="verifyinput()" id="signup" name="signup">
Thanks.
<input type="checkbox" name="iagree" id="iagree" onclick="clickIagree()"> I agree
and clickIagree() looks like this:
function clickIagree() {
if (document.signupform.iagre
document.signupform.signup
} else {
document.signupform.signup
}
}
My error debug message is saying document.signupform.signup
<form name="signupform" method="POST" action="thank_you.php" >
Perhaps it is my input image?
<input type="image" src="img/push-signup-small
Thanks.
@stevefNYC,
As per my knowledge you can't disable an image button.
I can provide you an alternative....write an innerHTML to the the div...write out <img src=""> without the anchor tag when you want to disable
As per my knowledge you can't disable an image button.
I can provide you an alternative....write an innerHTML to the the div...write out <img src=""> without the anchor tag when you want to disable
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You have to get it by ID.