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

Set cursor to the end of a textbox ?????

Status
Not open for further replies.

mnidhk

Programmer
Jan 24, 2001
2
NL
Hello,

i have a textbox which i use to calculate a prise of a product.For example the value of the textbox is 3, i read the value and show the right price for that product.

Problem is: i have an asp page and so i reload the page when a key is pressed and set the focus to the textbox with the value 3. The caret(cursor) is set to the first position of the textbox.I want to set the cursor to the end of the textbox so i can press the zero to order 30 pieces of that product and not 03 pieces. Is it possible to use a script for example in the body onload-event to set the cursor to the end of my textbox???

Can someone help me??? Thanks

Michel
 
you could try giving focus to the text box, then resetting the content to what's already in there. i think that should put the cursor at the end. adam@aauser.com
 
Thanks!!

A simple solution but it works perfectly!

Michel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top