Solved

check check-box to continue to next page

Posted on 2011-03-04
3
446 Views
Last Modified: 2012-05-11
hi

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?

Thanks!
0
Comment
Question by:peps03
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 10

Expert Comment

by:Umar Topia
ID: 35036124
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
0
 
LVL 9

Accepted Solution

by:
jkofte earned 500 total points
ID: 35036136
here is the working code:

<!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=utf-8" />
<title>PAGE</title>
<script type="text/javascript">
function CheckEnabled()
{
	if (document.getElementById('myCheckBox').checked)
	{
		document.getElementById('myButton').disabled = '';
	} else 
	{
		document.getElementById('myButton').disabled = 'disabled';
	}
}
</script>
</head>
<body>
<input id="myCheckBox" type="checkbox" onclick="CheckEnabled()" /> 
<input id="myButton" disabled="disabled" type="button" value="My Button" />
</body>
</html>

Open in new window

0
 

Author Closing Comment

by:peps03
ID: 35036211
great!!

thank you very much!!
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question