focus

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
enemeth
Forum Commoner
Posts: 66
Joined: Tue Mar 27, 2007 8:55 am

focus

Post by enemeth »

Can someone tell me how to set the focus on the first field in my form?

Thanks,

Elaine
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Moved to Client-Side.

Code: Select all

<body onload="document.formname.fieldname.focus()" >
Perhaps?
enemeth
Forum Commoner
Posts: 66
Joined: Tue Mar 27, 2007 8:55 am

Post by enemeth »

<body onload="document.formname.fieldname.focus()" >

put that , replaced the fieldname with the name of the field i want it to be focused on but it didnt work , do i have to add something in formname? or document also?

Thanks,

Elaine
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

enemeth
Forum Commoner
Posts: 66
Joined: Tue Mar 27, 2007 8:55 am

Post by enemeth »

thank you that worked !

Elaine
Post Reply