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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set focus to the last character of a textbox

Status
Not open for further replies.

mmarseil

Programmer
Apr 26, 1999
12
0
0
US
Does anyone know how to set focus to the last character of a textbox in javscript or vbscript.  For example when a page loads a value will be set in a textbox. Take the word "sample", for instance.  I want to set focus to the textbox and the cursor should appear after the "e" in "sample".  I know in normal VB you can use SelStart, but VBScript doesn't support this function.  Also, I've tried to populate that textbox and then set focus, hoping that the cursor would be at the end since there was already text in there, but it just put the cursor at the beginning of the word.  Any help would be greatly appreciated!!
 
This feature is not standard, definately wont work in Netscape, and I think is only available in IE5.<br><br>Here is the URL for Microsofts full docs on DHTML methods and objects.<br><br><A HREF=" TARGET="_new"> <p>Russ Michaels<br><a href=mailto:russ@satachi.com>russ@satachi.com</a><br><a href= Internet Development</a><br>Rapid Web application development, specialising in Coldfusion, database integration and e-commerce solutions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top