473,387 Members | 1,394 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

focus on first text form field w/o using onload

hello, is there any way to indicte a cursor on the first text user
input when a page loads without using onload in the body tag?
Jul 20 '05 #1
1 2019
"reneecccwest" <re**********@hotmail.com> wrote in message
news:c1*************************@posting.google.co m...
hello, is there any way to indicte a cursor on the first text user
input when a page loads without using onload in the body tag?

<html>
<head>
<title>focus.htm</title>
</head>
<body>
<form>
<input type="text" name="field1">
<input type="text" name="field2">
</form>
<script type="text/javascript">
document.forms[0].field1.focus();
</script>
</body>
</html>
Though, <body onload="document.forms[0].field1.focus()"> would be simpler.
Jul 20 '05 #2

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

Similar topics

2
by: Stuart Wexler | last post by:
Hi, I was wondering if there is any way with onload that I can highlight (blue color) the select box field while simultaneously placing the mouse cursor or focus on a text box immediately below...
11
by: JCO | last post by:
I have a text box, on my form that I cant get the focus on. I'm using it as shown: <head> <body onload=document.getPassword.txtPasswordName.focus()> </head> Where getPassword is the form &...
6
by: Csaba | last post by:
I'd like to have the cursor in the login form's username input text field when users load the login page. It works fine with the following implementation: <body...
5
by: Paul E Collins | last post by:
I have a Web form with a number of text boxes. If the user submits the page with some text boxes filled in, those then become plain text (with accompanying <input type="hidden"> fields for when the...
5
by: Rune Runnestø | last post by:
How do I focus the cursor in the input field 'numberField' when accessing this jsp-file (or html-file) ? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head>...
1
by: Zvonko | last post by:
Hi! As mentioned in title. How to do it? Thanks Zvonko
4
by: GTi | last post by:
Is it possible to have a generic script that set the input focus on the first valid element in a document (not hidden or disabled) ? This script is at the end of a document, but don't work. ...
5
by: linuxnooby | last post by:
This is a simple question but it is doing my head in all i want is a form text field to be focused when the page loads. Works in IE6 but not in Firefox 1.6 <body > <form...
2
by: Rey | last post by:
Howdy all. Using visual web developer (VB) on xp pro box. My problem with with a web form that on accessing the calendar control causes a postback that moves the cursor back to the txtFirstName...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...

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.