Welcome to Dream.In.Code
Getting Help is Easy!

Join 107,710 Programmers for FREE! Ask your question and get quick answers from experts. There are 1,108 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



Simple Javascript Countdown Timer

 
Reply to this topicStart new topic

Simple Javascript Countdown Timer, that displays in a button!

nanascalala
post 28 Aug, 2005 - 09:59 AM
Post #1


New D.I.C Head

*
Joined: 13 Jan, 2005
Posts: 31

Here's what i got. When you click submit, the button becomes disabled and the text changes to Loading... Please Wait. What I need to know is how to have it countdown 5 seconds and display the 5,4,3,2,1...

CODE
<script language="JavaScript" type="text/javascript">
<!--
function GoToStepTwo()
{
window.signupform.Submit.value="Loading... Please Wait...";
**(COUNTDOWN WOULD GO HERE)**
StepOne.className = 'hideMe';
StepTwo.className = '';
}
// -->
</script>

and then the form
CODE

<form method="post" action="http://www.somesite.com" name="signupform" target="iframe" onsubmit=window.signupform.Submit.disabled=true;GoToStepTwo()>
*STUFF*
<input type="submit" id="submitbutton1" name="Submit" value="Step 1" alt="Next">
</form>


So, what I need to figure out is how to do a countdown with Javascript, and display the button accordingly:
CODE

window.signupform.Submit.value="Loading... $seconds seconds left...";


Or something similiar to that nature. I am a noob at javascript and need your help! If you know of a tutorial that covers somethign like this or another post i missed, please point me to it!

Thanks!

This post has been edited by nanascalala: 28 Aug, 2005 - 10:02 AM
User is offlineProfile CardPM

Go to the top of the page


Amadeus
post 28 Aug, 2005 - 10:49 AM
Post #2


g++ -o drink whiskey.cpp

Group Icon
Joined: 12 Jul, 2002
Posts: 11,745



Thanked 17 times

Dream Kudos: 25
My Contributions


Javascript countdowns are relatively straightforward...I'll just point you in the dorection of a couple of scripts instead of typing them out myself...let us know if you need any help modifying them for your needs.

Here
Here
Here

These are just a few examples...
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 8/30/08 03:18AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month