Chat LIVE With Programming Experts! There Are 23 Online Right Now...

Welcome to Dream.In.Code
Become an Expert!

Join 244,293 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 932 people online right now. 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
28 Aug, 2005 - 08:59 AM
Post #1

New D.I.C Head
*

Joined: 13 Jan, 2005
Posts: 31



Thanked: 3 times
My Contributions
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 - 09:02 AM

User is offlineProfile CardPM
+Quote Post


Amadeus
RE: Simple Javascript Countdown Timer
28 Aug, 2005 - 09:49 AM
Post #2

g++ -o drink whiskey.cpp
Group Icon

Joined: 12 Jul, 2002
Posts: 12,977



Thanked: 116 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 online!Profile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 7/4/09 04:06PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month