473,498 Members | 1,218 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5860
> "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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
2735
by: Phillip Parr | last post by:
Hello, I know there is no way in Javascript to make the task bar flash when your window is minimised. However, I found out recently that if a javascript alert is sent to netscape when the window...
1
6674
by: MissiMaths | last post by:
I don't know if this is a stupid question but I have a textbox in a form and the text entered into it is only recognised if it has been tabbed or returned out of. Is there anyway to get the cursor...
1
5966
by: Thilo Frank | last post by:
I want to add a flashing text cursor to my selfmade user control. Is there an existing class availible for this problem or do I have to write a thread, which flashs the cursor? THX for your help...
1
3817
by: objectref | last post by:
Hi to all, we have the MousePosition property that we can get the Point of the position of the mouse cursor on the screen, but is it there a way to get the respective Point of a cursor in a...
3
5163
by: Adriana Camargo | last post by:
Hi I have to change automatically the text inside a textbox. I need to add thousand separator when I am writting in the textbox. I am using TextChanged event and when I insert a new number, i...
1
3128
by: Marc Robitaille | last post by:
Hello I build a usercontrol. On this new control, I added two controls, a TextBox and a ComboBox. My ComboBox is filled with a DataTable. When the user types something in the TextBox, I apply a...
0
1699
by: chatelain | last post by:
I'm using vb.net's datagrid in a windows application. So far I have not found any successful code to select a specific cell, select the text inside a specific cell or simply place the flashing cursor...
3
11912
by: fbergroth | last post by:
Hi, I'm quite new to C# allthough I've been programming in other languages for quite a while. I'd like to change the blinking cursor inside a TextBox, I guess I must derive the class and...
4
64844
by: Brandon McCombs | last post by:
Does anyone know of an easy way to set the position of the cursor in a TextBox? If I set text in the box that is longer than the length of the TextBox the position of the cursor is at the very end...
0
7200
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6884
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7375
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5460
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4904
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3090
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
651
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
287
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.