By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,814 Members | 2,183 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,814 IT Pros & Developers. It's quick & easy.

Putting flashing cursor in textbox automatically

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
> "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

P: n/a
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.