Forums
This topic is locked
How do you set Focus on Form Fields?
04 Jan 2003 18:37:04 James Lee posted:
Hello Everybody!I am just curious how do you set the blinking text cursor blink at the very first text box in a form without clicking in the text box? That means by default, it should be blinking at the very 1st text box without selecting it. This way it should be more comfortable for the user rather than having to select by himself.
Thanks for readning this!
Replies
Replied 06 Jan 2003 00:47:19
06 Jan 2003 00:47:19 Jeremy Conn replied:
It is actually very easy...
Just place this onLoad event into your BODY tag as shown. Then customize the different parts based upon your form and element names.
<b>onLoad="document.formname.fieldname.focus()"</b>
formname = Whatever your actual form's name is
fieldname = Whatever field you want the cursor in
(DWMX|IIS5|Access2K|XP|ASP/VB)
*Connman21*
www.conncreativemedia.com
Just place this onLoad event into your BODY tag as shown. Then customize the different parts based upon your form and element names.
<b>onLoad="document.formname.fieldname.focus()"</b>
formname = Whatever your actual form's name is
fieldname = Whatever field you want the cursor in
(DWMX|IIS5|Access2K|XP|ASP/VB)
*Connman21*
www.conncreativemedia.com
Replied 04 Jul 2003 16:56:29
04 Jul 2003 16:56:29 Wil Turrin replied:
Is there an alternate method than using the BODY tag?
MX's templates lock the BODY tag, so if I want to use the onLoad statement on one or two pages, I'd have to unlock the template.
W
Sup
MX's templates lock the BODY tag, so if I want to use the onLoad statement on one or two pages, I'd have to unlock the template.
W
Sup
Replied 07 Jul 2003 23:40:42
07 Jul 2003 23:40:42 Lee Diggins replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote> Is there an alternate method than using the BODY tag?
MX's templates lock the BODY tag, so if I want to use the onLoad statement on one or two pages, I'd have to unlock the template.
W
Sup
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
You need to select the Body tag then use the menu:
Modify|Templates|Make Attributes Editable
You'll need to add the onLoad event in the 'Editable Tags Attributes' dialogue box.
Digga
Sharing Knowledge Saves Valuable Time!!!
Edited by - Digga the Wolf on 07 Jul 2003 23:41:52
MX's templates lock the BODY tag, so if I want to use the onLoad statement on one or two pages, I'd have to unlock the template.
W
Sup
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
You need to select the Body tag then use the menu:
Modify|Templates|Make Attributes Editable
You'll need to add the onLoad event in the 'Editable Tags Attributes' dialogue box.
Digga
Sharing Knowledge Saves Valuable Time!!!
Edited by - Digga the Wolf on 07 Jul 2003 23:41:52