Solved

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

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Accordion won't close correctly 5 17
HTML INPUT 6 39
close pop up windows when logout or main window closes 17 86
CSS - how to make button/link change to black on hover? 2 35
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
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…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

751 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