Solved

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

Posted on 1998-09-29
1
143 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
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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

777 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