468,783 Members | 1,576 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,783 developers. It's quick & easy.

Putting flashing cursor in textbox automatically

Xam
Hello Everybody

Can you let me know of a javascript/dom routine that will automatically put
the flashing cursor in the first text box in my form so that it is ready for
entry rather than the user having to click into the first textbox with their
mouse.

Please note that my forms are created dynamically so I won't know the given
name of the first textbox so some form of index would be better.

I have a JS one liner that I've tried, but it doesn't show the cursor
flashing in the text box ready for input. As far as the user is probably
concerned, they think they still have to click into the text box first
before they can type something in because it doesn't look like the textbox
is ready for text entry.

Thanks XAM
Oct 1 '05 #1
2 5662
> "Xam" <se*@sec.com> wrote:
news:11*************@corp.supernews.com....

Hello Everybody

Can you let me know of a javascript/dom routine that will
automatically put the flashing cursor in the first text box in my
form so that it is ready for entry rather than the user having to
click into the first textbox with their mouse.

Please note that my forms are created dynamically so I won't know the
given name of the first textbox so some form of index would be better.

I have a JS one liner that I've tried, but it doesn't show the cursor
flashing in the text box ready for input. As far as the user is
probably concerned, they think they still have to click into the text
box first before they can type something in because it doesn't look
like the textbox is ready for text entry.

Thanks XAM


<script type="text/javascript">
window.onload = function k(){document.forms[0].elements[0].focus()}
</script>
--
BootNic Saturday, October 01, 2005 5:16 PM

Behind every successful woman...is a substantial amount of coffee.
*Stephanie Piro*

Oct 1 '05 #2
Xam
Thank you BootNic
"BootNic" <Bo*****@bounce.prodigy.net> wrote in message
news:e1****************@newssvr19.news.prodigy.com ...
"Xam" <se*@sec.com> wrote:
news:11*************@corp.supernews.com....

Hello Everybody

Can you let me know of a javascript/dom routine that will
automatically put the flashing cursor in the first text box in my
form so that it is ready for entry rather than the user having to
click into the first textbox with their mouse.

Please note that my forms are created dynamically so I won't know the
given name of the first textbox so some form of index would be better.

I have a JS one liner that I've tried, but it doesn't show the cursor
flashing in the text box ready for input. As far as the user is
probably concerned, they think they still have to click into the text
box first before they can type something in because it doesn't look
like the textbox is ready for text entry.

Thanks XAM


<script type="text/javascript">
window.onload = function k(){document.forms[0].elements[0].focus()}
</script>
--
BootNic Saturday, October 01, 2005 5:16 PM

Behind every successful woman...is a substantial amount of coffee.
*Stephanie Piro*
Oct 1 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Phillip Parr | last post: by
1 post views Thread by MissiMaths | last post: by
1 post views Thread by Thilo Frank | last post: by
1 post views Thread by objectref | last post: by
1 post views Thread by Marc Robitaille | last post: by
3 posts views Thread by fbergroth | last post: by
4 posts views Thread by Brandon McCombs | last post: by
2 posts views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.