check check-box to continue to next page


i have a check-box on my page, i would like it to be checked before a button to the next page will become active.
(the check-box says accept our terms)

how can this be done?

Who is Participating?
jkofteConnect With a Mentor Commented:
here is the working code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript">
function CheckEnabled()
	if (document.getElementById('myCheckBox').checked)
		document.getElementById('myButton').disabled = '';
	} else 
		document.getElementById('myButton').disabled = 'disabled';
<input id="myCheckBox" type="checkbox" onclick="CheckEnabled()" /> 
<input id="myButton" disabled="disabled" type="button" value="My Button" />

Open in new window

Umar Topia.Net Full Stack DeveloperCommented:
You can keep the button disable initially and on check changed event of your checkbox you can check whether current value of checkbox is checked or not... if yes then enable the button otheriwse disable the button
peps03Author Commented:

thank you very much!!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.