473,503 Members | 756 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

onload moving cursor (focus) on first field of form

Hi!

As mentioned in title. How to do it?

Thanks
Zvonko
Aug 26 '05 #1
1 2437
The easier version...

<body onload="document.forms[0].elements[0].focus();">

Or the better version...

<script language="javascript" type="text/javascript">
function loadFocus() {
document.forms[0].elements[0].focus();
}
window.onload = loadFocus;
</script>

Both will give the focus to the first field in the first form.

Binny V A
http://binnyva.blogspot.com

Aug 26 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1371
by: Peter Franklin | last post by:
I have a form which has a tab control with several pages. When the form is opened, the focus is on the first field of the first page of the tab control, instead of the first field of the form. ...
4
2178
by: Randy | last post by:
Hello all, I have a form with a text field (textBox1) on it. Apparently, textBox1.Focus() doesn't work when the form is initializing. I put this in the Constructor and also in the Load event for...
0
1601
by: dmedina | last post by:
I have a form with about 5 or 8 textboxes and all of them have required field validators... When I submit the form, if some of this field are empty I show the Summary msg telling the user which...
3
8305
by: Steve Yerkes | last post by:
There seems to be way too much confusion over how to set focus on the a field using a field validator. I looked all over the web and found people trying to do this, but not getting anywhere. There...
2
4586
by: AA Arens | last post by:
I want the cursor focuses on the first field when starting a new record. Now I have to use my mouse. How to solve it? Bart Access 2003
1
2239
by: David R. | last post by:
Using <asp:Login ID="Login1" runat="server"> Is it possible to set the initial cursor focus on the Username text field when the page initially loads?
0
902
by: Jerry Spence1 | last post by:
I've tried the following: Dim DP As New System.Drawing.Point DP.X = 50 DP.Y = 60 Windows.Forms.Cursor.Position = (DP) However, I want to move it inside an MDI form, and the above moves...
5
7574
by: mail2kondeti | last post by:
Hi Here I need know small clarification. I did this long time back. If I want to show the cursor in the first field when the page gets loaded, how we have to do? Ex. if you goto...
0
1909
by: jvitti | last post by:
I recently upgraded from Access 2000 to Access 2007 and I am having trouble with moving the focus from 1 form to another. While doing data entry if a similar claim is found the claim view form...
0
7339
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
6995
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
7463
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
5581
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,...
0
4678
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3157
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1515
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
738
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
389
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.