469,314 Members | 2,169 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,314 developers. It's quick & easy.

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

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
1 2203
acoder
16,027 Expert Mod 8TB
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.

Similar topics

8 posts views Thread by localhost | last post: by
3 posts views Thread by Chantal | last post: by
7 posts views Thread by howa | last post: by
2 posts views Thread by Richard Maher | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.