Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Old 11-17-2006, 08:28 PM Help me with Button
Experienced Talker

Posts: 37
Name: Paul
Trades: 0
I want to make this:
When page loads there will be a button, but I want for it to be disabled (can't click it) for specified time.

For example when page loads I want the button to look like this:
"Submit (10)" after 1 second - "Submit (9)" and so on....
when the timer reaches 0, the button would be enabled, so now you can click it, it will work and redirect you to any specified location.

Thank you for help
Athlon1600 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-18-2006, 08:38 AM Re: Help me with Button
Skilled Talker

Posts: 84
Trades: 0
http://www.microsoft.com/technet/scr...5/hey0314.mspx any help?
dodz is offline
Reply With Quote
View Public Profile
 
Old 11-18-2006, 09:48 AM Re: Help me with Button
Experienced Talker

Posts: 37
Name: Paul
Trades: 0
that's for visual basic
I need html code for that
Athlon1600 is offline
Reply With Quote
View Public Profile
 
Old 11-18-2006, 10:39 AM Re: Help me with Button
Skilled Talker

Posts: 84
Trades: 0
THB, I'm not entirely sure it's doable with HTML. I know it's doable with Javascript.

I'm a little rusty with JS so I dunno if this will work or not....


Code:
function init() {
  var o = document.getElementById('blah');
  o.count_down = 10000;
  count(o);
}
function count(o) {
  if(o.count_down) {
    o.count_down -= 1000;
    o.value = 'submit('+o.count_down/1000+')';
    window.setTimeout(function() {
      count(o); }, 1000);
  }
  else {
    o.value = 'submit';
    o.disabled = false;
  }
}
onload = init;
And you'll need to add this code to the page
Code:
<input type='submit' id='blah' disabled='disabled' value='submit(10)' />

Last edited by dodz; 11-18-2006 at 10:42 AM..
dodz is offline
Reply With Quote
View Public Profile
 
Old 11-18-2006, 11:48 AM Re: Help me with Button
Experienced Talker

Posts: 37
Name: Paul
Trades: 0
It works.
I actually posted the same thread in "Javascript" forum section. Got the same answer too
Thank for help anyways
Athlon1600 is offline
Reply With Quote
View Public Profile
 
Old 11-18-2006, 12:15 PM Re: Help me with Button
Mooofasa's Avatar
Defies a Status

Posts: 1,611
Name: Michael (mik) Land
Location: England
Trades: 0
Making it in VisualBasic6 would be even easier, but this is not VB and it won't help for the web neither.

It's not doable in pure HTML as it requires client-side scripting language.

Just make sure to provide an alternative method for Javascript-disabled browsers.

Before implementing dodz script, make sure to change variable names and id 'blah' to useful ones.
__________________

Please login or register to view this content. Registration is FREE
- Tumblog with thoughts, quotes, links, videos, images and my creations.

Please login or register to view this content. Registration is FREE
- The best free web browser.

Please login or register to view this content. Registration is FREE
- Firefox is now Firefail.
Mooofasa is offline
Reply With Quote
View Public Profile Visit Mooofasa's homepage!
 
Old 11-18-2006, 12:24 PM Re: Help me with Button
Skilled Talker

Posts: 84
Trades: 0
Quote:
Originally Posted by dodz View Post
THB, I'm not entirely sure it's doable with HTML. I know it's doable with Javascript.

I'm a little rusty with JS so I dunno if this will work or not....


Code:
function init() {
  var o = document.getElementById('blah');
  o.count_down = 10000;
  count(o);
}
function count(o) {
  if(o.count_down) {
    o.count_down -= 1000;
    o.value = 'submit('+o.count_down/1000+')';
    window.setTimeout(function() {
      count(o); }, 1000);
  }
  else {
    o.value = 'submit';
    o.disabled = false;
  }
}
onload = init;
And you'll need to add this code to the page
Code:
<input type='submit' id='blah' disabled='disabled' value='submit(10)' />
o.o Really? Hehe, well it's probably correct then.
Good luck.
dodz is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Help me with Button
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.26341 seconds with 12 queries