Solved

check check-box to continue to next page

Posted on 2011-03-04
3
467 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

WordPress Tutorial 1: Installation & Setup

WordPress is a very popular option for running your web site and can be used to get your content online quickly for the world to see. This guide will walk you through installing the WordPress server software and the initial setup process.

Question has a verified solution.

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

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.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Suggested Courses

632 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