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

How to get cursor at the end of text in textbox ?

Status
Not open for further replies.

dommett

Programmer
Apr 30, 2004
33
0
0
US
I have an asp file using vbscript and a html form. I have a tab order set up and when the user tabs to one of my form fields that is a prefilled textbox, I want the cursor to go to the end of the text in the box. Can anyone tell me how to do this?
Thanks,
Amy
 
What does it do now - highlight the whole text?

sendkeys f2 would do it - probably not the cleanest solution though.

Private Sub your_field_GotFocus()
SendKeys "{f2}"
End Sub
 
Hang on, though I was still in the VBA forum . . .

That probably won't work as it is. But it's nearly the right answer.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top