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!

cursor and text box

Status
Not open for further replies.

ABJ

Technical User
Aug 29, 2000
16
0
0
AU
Hey guys,
hope you can help - I have built a page with a text box and i would like the cursor is flashing in that box when you enter the page. So you don't have to click then type then press enter.
If this is possible - any help would be very much appreciated
Regards Al
 
In the body tag onload call a javascript function to achieve this.

<body onload=&quot;doFocus()&quot;>

<form name=&quot;frmName&quot;>

<input type=&quot;text&quot; name=&quot;text1&quot;>

<script language=&quot;javaScript&quot;>

// start function doFocus
// this function get the focus of the cursor to the text box

function doFocus()
{
document.frmName.text1.focus();
document.frmName.text1.select();
}
// end of function doFocus()

</script>

</form>

</body>

// you can try the above.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top