
How to Set Focus to a Form Field
Use Javascript
EX:
Here is the form field
<FORM NAME="formDimensions">
<INPUT TYPE="text" SIZE="10" NAME="NumberAcross" VALUE="
</FORM>
Here is some Javascript
<SCRIPT LANGUAGE="JavaScript">
<!-- Activate Cloaking Device
//
function StartUp()
{
document.formShape.Shape.focus();
some other stuff etc.....
}
// Deactivate Cloaking -->
</SCRIPT>
Put this at the very end of your asp
<SCRIPT LANGUAGE="Javascript">
<!--
StartUp()
//-->
</SCRIPT>
or use the body onload event to call startup or just put the focus call into
the onload event.
Tom
Quote:
>>Does anyone know how to set focus to a field in an HTML form? I know you
>can
>>use the SetFocus method if you use the Microsoft Forms 2.0 ActiveX control
>>on a page. But I'm looking for the equivalent code to use with just HTML
>>forms?
>>Thanks,
>>Hossein Mafinejad