Solved

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

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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

713 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