Entry
How do I get a form page to load with the cursor already flashing in the first text box field
Jun 5th, 2002 07:23
jsWalter, Ade Bedford,
This is what I use...
// Set focus to the first item
function focusFirstItem()
{
// This will only work IF we have
// an element to focus on
if ( document.forms[0] )
document.forms[0].elements[0].focus();
}
This example this will set FOCUS on the first item in a Form,
regardless what type it is.
If we take the question asked literally, and we nedd to to FOCUS on the
first TEXT box...
Think of this as an excersise to see how to modify this example to
FOCUS on the first TEXT box only.
Ade, please hand in your homework by the end of the week. ;)
Class dismissed.
Walter