View Full Version : Focus script breaks dynamic clock

12-08-2007, 08:43 PM
This focus script is also used by Google:

<body bgcolor="#FFFFFF" text="#000000" onLoad=sf()>
function sf(){document.thisfield.thisfield_text.focus();}

And it works great for focussing a text input on page load. But it causes a dynamic clock to break, which is found here (http://www.designerwiz.com/24fun/clockinnertext/clockinnertext.html).

Could anyone publish the required code change to make them work together? Thank you.

Philip M
12-08-2007, 09:32 PM
You have two onload() statements, and the second over-writes the first.


You can fix this as follows:-

<body bgcolor="#FFFFFF" text="#000000" onLoad="clockon();sf()">

and delete window.onload=clockon from the clock script.

For more info see:-


12-08-2007, 09:41 PM
Great, thank you so much. It's working. Now I'm only having trouble with a character. When the clock was frozen I had it appear with & instead of :. Now it refuses to display that & character. What fixes that?

rnd me
12-08-2007, 10:35 PM
use &amp; instead...

12-09-2007, 01:28 AM
Great, thank you.