Solved

how to give a focus to a text field in the form?

Posted on 1998-09-29
1
147 Views
Last Modified: 2010-04-09
Hi!
This is my problem. I want to give a focus to the input text field in the form.
I've written  an event handler to the "onLoad" event of the document containing my form
like:
function DoOnLoad() {
  self.document.myform.inputbox1.focus;
}
and in the body of the form there is a string like:
<input type="text" name="inputbox1">

but that all does'nt work : in IE 30 the first text field is always focused and
in NN 30 no of fields are bocused at all.

What I did wrong?

Thanks in advance.
0
Comment
Question by:abb1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 28

Accepted Solution

by:
sybe earned 20 total points
ID: 1838206
function DoOnLoad() {
 document.myform.inputbox1.focus();
}

you forgot the "()" after focus
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question