Forums

This topic is locked

Tabs in form fileds

Posted 19 Sep 2001 13:50:02
1
has voted
19 Sep 2001 13:50:02 Paul Rossiter posted:
When a page loads that contains a form, i want to automatically acitivate the first field so the user doesn't have to click inside it before typing. Anyone have any ideas on how to do this?

Replies

Replied 04 Oct 2001 14:10:03
04 Oct 2001 14:10:03 Praveen Kumar replied:
do the following ..

in your body tag add the following
onload="document.a.spk100.focus();"

it will look like this
<body onload="document.a.spk100.focus();">
name your form "a". (explanation below)
then in you form add the following.
name="spk100"
in the first form field. it will look like this <input name="spk100" type="text">
and add all the other fields. and other things you require.
change the name tag (spk100) in the form as to whatever you want. and do the corresponding change in the onload function.

explanation of onload="document.a.spk100.focus();"

a=form name,
spk100=form field name.

you can change this to suit your form.

then it will work as you expect.

spk100

www.spk100.f2s.com

Edited by - spk100 on 10/04/2001 14:17:35
Replied 05 Oct 2001 14:21:09
05 Oct 2001 14:21:09 Paul Rossiter replied:
Thanks for this it certainly works as a standard page but has difficulties with framed pages. Any ideas on how this can be overcome?

Replied 05 Oct 2001 14:55:32
05 Oct 2001 14:55:32 Praveen Kumar replied:
i tried it in the frames page also
it works fine. same thing as a standard page.

just make sure that the form name,text field name and the onload function are the same.
it will work properly.
if u run into any problems letme know.

and btw do not use the same names for 2 forms(in case u plan to use 2 separate forms) in that page.
otherwise it should/will work fine.
have fun

spk100

www.spk100.f2s.com

Reply to this topic