Cursor to end of line in textbox

G

Gyetko

I have a textbox on an ASP.NET webform (VB code behind). Is there a
way for me to set the cursor to the end of the line on a gotfocus call?
Right now I'm using the following to set the foucs to that textbox on
a keypress (given certain criteria). Thanks.

document.forms[0].myTextBox.focus()
// document.forms[0].myTextBox.EOL --- would be nice here : )

Or I could use it somewhere here when it actually gets the focus:

Page Load VB:
myTextBox.Attributes.Add("onfocus", "setGotFocus()")

JavaScript:
function setGotFocus()
{
// document.forms[0].myTextBox.EOL --- would be nice here : )
document.forms[0]['myTextBox'].value = myVariable
}
 
G

Guest

try adding a space to the end of the text box and selecting it. Good luck
making it work on all browsers.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top