HighDots Forums  

How to set focus to a radio button without <body>

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss How to set focus to a radio button without <body> in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
WestSide
 
Posts: n/a

Default How to set focus to a radio button without <body> - 07-20-2004 , 09:05 PM






Hi,

I wanted to find out... does anyone know how to set focus to a radio button
when the page loads, besides using the body tag.

Currently the body tag in this app has an OnLoad event... is there another way?

Ideally something where I could use on all my forms would be cool, but if not,
I will take what I can get..

Any thoughts?

-WestSide


Reply With Quote
  #2  
Old   
Michael Fesser
 
Posts: n/a

Default Re: How to set focus to a radio button without <body> - 07-20-2004 , 09:26 PM






.oO(WestSide)

Quote:
I wanted to find out... does anyone know how to set focus to a radio button
when the page loads, besides using the body tag.

Currently the body tag in this app has an OnLoad event... is there another way?
You can have multiple scripts/calls on the onload-event, separated by
semi-colons:

<body onload="doThis(); doThat(); doNothing(); wasteTime();">

HTH
Micha


Reply With Quote
  #3  
Old   
Josh Johnson
 
Posts: n/a

Default Re: How to set focus to a radio button without <body> - 07-20-2004 , 09:42 PM



Michael Fesser wrote:
Quote:
You can have multiple scripts/calls on the onload-event, separated by
semi-colons:

body onload="doThis(); doThat(); doNothing(); wasteTime();"
Or to keep it simple, I usually create an initialization function like

<body onload="init();">

and then call all the startup functions in one script in the head like

<script>
function init() {
doThis();
doThat();
doNothing();
wasteTime();
}
</script>

A little bit longer, but I find it easier to read and debug, since it's
easy to comment out one function at a time for testing.

- Josh


Reply With Quote
  #4  
Old   
Gary White
 
Posts: n/a

Default Re: How to set focus to a radio button without <body> - 07-21-2004 , 12:01 AM



"WestSide" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
I wanted to find out... does anyone know how to set focus to a radio
button
when the page loads, besides using the body tag.


In addition to the other replies, you can insert a small script block in the
body of the page as long as it is AFTER the object you're setting focus to.
I'd suggest putting it right before the closing </body> tag.

Gary




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.