Forums

This topic is locked

Editable Regions and Body OnLoad

Posted 03 Jul 2003 19:03:14
1
has voted
03 Jul 2003 19:03:14 Wil Turrin posted:
Hi,

I've been using templates for a while now and have run into an interesting dilemma.

On some pages, I need to be able to add Body OnLoad="document.formname.fieldname.focus()"

This will be different each time so I need to make the body tag editable.

Any thoughts on how to make this happen? I'm stumped.

Sup

Replies

Replied 04 Jul 2003 17:22:22
04 Jul 2003 17:22:22 Marja Ribbers-de Vroed replied:
I don't think it's possible to make the BODY tag itself an editable region.

What you could do however, is placing a generic function call on the BODY tag in the template itself and adding a dummy JavaScript function in an editable region in the HEAD section of the template.

E.g.
<pre id=code><font face=courier size=2 id=code>
function customOnload() {
// whatever you would want to do here
}
</font id=code></pre id=code>
<pre id=code><font face=courier size=2 id=code>
&lt;body onload="customOnload()"&gt;
</font id=code></pre id=code>

Then on child pages you can fill in the "dummy" function with custom code for that page.

--
Marja Ribbers-de Vroed
www.flevooware.nl
www.flevooware.nl/dreamweaver/


Edited by - MarjaR on 04 Jul 2003 17:23:14
Replied 04 Jul 2003 17:24:27
04 Jul 2003 17:24:27 Wil Turrin replied:
Hey Marja,

I pretty much came to the same conclusion about making the body tag editable.

And the funny thing is, I just made a dummy script and plugged it into the template.

So although your suggestion was five minutes too late, thanks! It rocks and it works too!

Sup

Reply to this topic