0
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Simple</title>
<script type="text/javascript">

function showHide()
        {
            if(document.getElementById('Checkbox1').checked)
            {
                submit.disabled=false;
                //document.getElementById('submit').disabled = false;
            }
            else
            {
                submit.disabled=true;
                document.getElementById('submit').disabled = true;
            }
        }


    </script>
</head>

<body><h3>Online Application Checklist</h3>
<p><br /> <br /> Please review the following before proceeding<br /> <br /></p>
<fieldset id="hcad4_4387"> <legend id="hcad4_4387_label">I have read and agree to the Terms of Service</legend> <input id="Checkbox1" onclick="showHide();" type="checkbox" /> <label for="hcad4_4387_0">I Agree</label> </fieldset>
<p><br /> <input id="submit" onclick="location.href='http://www.simpleseparation.ca/index.php?option=com_jforms&amp;view=form&amp;id=7&amp;Itemid=72';" disabled="true"  type="submit" value="Submit" /></p>
</body>
</html>

please help me...
Thanks in advance.

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by Nitashan
0

Right... Line 12 + 17 - variable 'submit' undeclared. You should use the following:

function showHide()
        {
            if(document.getElementById('Checkbox1').checked == true) // If the checkbox is already checked
            {
                document.getElementById('submit').disabled = true;
            }
            else // If the checkbox is not yet checked
            {
                document.getElementById('submit').disabled = false;
            }
        }

And in your form:

<input id="Checkbox1" onclick="showHide(); return true;" type="checkbox" />

If this does not work, perhaps you should alert() the variables you retrieve out of the HTML using getElementById()...

~G

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.