Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

check check-box to continue to next page

Posted on 2011-03-04
3
Medium Priority
?
499 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
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 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
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…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

876 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