Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


Position Cursor in a Particular Text Box

Keywords:   position cursor

Question:

When I load an HTML file with text input form fields, how can I make sure that the cursor is placed in a particular text box so the user can start typing right away?

Answer:

Using '[' and ']' for '<' and '>'. You have to name your form:
[FORM NAME="AnyName" METHOD=POST]
Then at the end of your script insert these lines:
[SCRIPT LANGUAGE="JavaScript"]
[!--
window.document.AnyName.???.focus();
//--]
[/SCRIPT]
[/HTML]
Just substitute '???' with the control you want to receive the focus.
Article ID:   W14532
Filename:   Position Cursor in a Particular Text Box.txt