...

View Full Version : form field focus



nikko50
01-18-2006, 08:49 PM
Is it possible to place focus on a text field without using body onload??

vwphillips
01-18-2006, 08:52 PM
onload=document.getElementById('mytextfieldid')focus();"

nikko50
01-18-2006, 08:54 PM
How about without using <body onload>? Thanks
Tracy

arnyinc
01-18-2006, 09:49 PM
vwphillips suggestion can be placed in a javascript block, not in the body tag.

Just out of curiousity, why don't you want it in the <body onload>?

vwphillips
01-18-2006, 10:19 PM
you can also use window onload

or use th call a function as previous post if the block is placed after the textbox element

plus typo
should be
onload=document.getElementById('mytextfieldid').focus();

glenngv
01-19-2006, 03:23 AM
Typo too?


plus typo
should be
onload=document.getElementById('mytextfieldid').focus();
Should it be

onload=function(){document.getElementById('mytextfieldid').focus()};
?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum