Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form Question 1

Status
Not open for further replies.

bn2hunt

MIS
May 15, 2003
203
US
This is probably an easy question, but I to this point have been unable to find the answer, problably not asking the right question. I have a site that just has some headings and a form. How do I get the cursor in the First inputbox on the form when the page loads?

<html>
<head><title>In/Out Board</title></head>
<body TOPMARGIN=0 LEFTMARGIN=50 BGPROPERTIES=&quot;FIXED&quot; LINK=&quot;#000000&quot; VLINK=&quot;#808080&quot; ALINK=&quot;#000000&quot; BGCOLOR= BLUE text = white FONT>
<table align = center>
<tr><td align = center><h1>headin1</h1></td></tr>
<tr><td align = center><h1>heading2</h1></td></table>

<FORM ACTION=&quot;script.asp&quot; METHOD=post>
<h2>Enter your UserID?</h2>
<P><INPUT TYPE=&quot;text&quot; NAME=&quot;usrnme&quot;></P>
<h2>Enter your password?</h2>
<P><INPUT TYPE=&quot;password&quot; name=&quot;pass&quot;</P>
<p><INPUT TYPE=&quot;submit&quot; VALUE=&quot;Submit Query&quot;></p>
<INPUT TYPE=&quot;reset&quot; VALUE=&quot;Reset&quot;>
</FORM>


Thanks

Ddnwolff
 
Hi,

Make the following changes:

<body TOPMARGIN=0 LEFTMARGIN=50 BGPROPERTIES=&quot;FIXED&quot; LINK=&quot;#000000&quot; VLINK=&quot;#808080&quot; ALINK=&quot;#000000&quot; BGCOLOR= BLUE text = white onload=&quot;document.MyForm.usrnme.focus()&quot;>

<FORM ACTION=&quot;script.asp&quot; METHOD=post NAME=&quot;MyForm&quot;>

John
 
another variation of this would be adding this script after the

</form>

<script language=&quot;javascript&quot;>
<!--
document.form_name.form_field.focus();
//-->
</script>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top