By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,781 Members | 1,134 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,781 IT Pros & Developers. It's quick & easy.

Checkbox - show <div> when checked, or perform <meta refresh> if not checked

P: 19
I have a web page that uses the following JavaScript to hide a <div> unless the checkbox is checked:

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2. function showMe (it, box) {
  3. var vis = (box.checked) ? "block" : "none\
  4. document.getElementById(it).style.display = vis;
  5. }
  6.  
I need to have it where if the box is not checked with 10 seconds, then a <meta refresh> is initiated, and the user is redirected to another page.

[HTML]<meta http-equiv="refresh" content="10;url=http://www.chevyoffers.com">[/HTML]

Any help is appreciated.

Thanks - Tony
Oct 18 '07 #1
Share this Question
Share on Google+
1 Reply


acoder
Expert Mod 15k+
P: 16,027
Use a setTimeout which calls a function after 10 seconds. If the checkbox is unchecked, use window.location.href to redirect the user.
Oct 18 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.