Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

javascript countdown


  • This topic is locked This topic is locked

#1
Ryan

Ryan

    Member 4k

  • Member
  • PipPipPipPipPipPipPip
  • 4,867 posts
OK, so I have the script, and it works. The only problem is that there is a border around the numbers. I want to get rid of that border,but I can't seem to find a way. Is it possible? Here is the code.

in <head>
<script type="text/javascript">

//change your event date event here.
var eventdate = new Date("May 11, 2006 18:00:00 GMT");

 function toSt(n)
 {s=""
  if(n<10) s+="0"
  return s+n.toString();
 }
 
 function countdown()
 {cl=document.clock;
  d=new Date();
  count=Math.floor((eventdate.getTime()-d.getTime())/1000);
  if(count<=0)
	{cl.days.value ="--";
	 cl.hours.value="--";
	 cl.mins.value="--";
	 cl.secs.value="--";
	 return;
	}
  cl.secs.value=toSt(count%60);
  count=Math.floor(count/60);
  cl.mins.value=toSt(count%60);
  count=Math.floor(count/60);
  cl.hours.value=toSt(count%24);
  count=Math.floor(count/24);
  cl.days.value=count;	
  
  setTimeout("countdown()",500);
 }

</script>

and in <body>
<form name="clock" action="none">

<input name="days" size="1" /> Days, <input name="hours" size="1" /> Hours, <input name="mins" size="1" /> Minutes, and <input name="secs" size="1" /> seconds.

</form>

Thanks in advance for any help.

-Ryan

Edited by rmurphy, 22 April 2006 - 12:12 AM.

  • 0

Advertisements


#2
Major Payne

Major Payne

    Retired Staff

  • Retired Staff
  • 5,307 posts
Kinda late on this one, but I believe that as long as you use the <input> tags, you'll get that "little border" around the input box.

Ron
  • 0

#3
Michael

Michael

    Retired Staff

  • Retired Staff
  • 1,869 posts
The thread is a year old. Don't you think it is a bit silly replying to it Major Payne?

You can add style="border:0" to remove the border from the input.
  • 0

#4
Major Payne

Major Payne

    Retired Staff

  • Retired Staff
  • 5,307 posts
Actually, no! I was clearing out all my pending ones that were put off answering because I was offline close to a year because of Katrina. And, no, you can not use border="0" because they are using <input> tags and what you see are not borders. Now I may be silly answering this after a year, but why are you here posting?

Ron
  • 0

#5
Michael

Michael

    Retired Staff

  • Retired Staff
  • 1,869 posts
I am posting to correct what you say. And I never said border="0". I said style="border:0"

And they are borders. If you don't believe me try <input style="border:0" value="text with no border">
  • 0

#6
Major Payne

Major Payne

    Retired Staff

  • Retired Staff
  • 5,307 posts
:whistling: I disagree ole Master, but end of posting. :blink:

Ron
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP