Hi,
I've been pointed in the direction of the Javascript forum to answer a question i posted on the ASP.NET forum. I found a similar post in this forum titled "Set cursor to the end of a textbox ?????" and i think the solution could work, but I have absolutely no experience with Javascript and the solution does not explain what to do. Can someone help?
Here's my original question.
I am using a button to insert a string into a textbox on my webform. I want the cursor position to be set to the end of the inserted text so the user can continue typing without having to manually reposition the cursor.
In a VB.NET windows form i'd use...
TextBox1.Text = "Hello World"
TextBox1.Focus()
TextBox1.SelectionStart = TextBox1.Text.Length
I can insert the text and focus back onto the textbox, but when the textbox recieves focus the cursor is reset to the start of the text.
Does anyone know how i can set the cursor to the end in ASP.NET?
Thanks
I've been pointed in the direction of the Javascript forum to answer a question i posted on the ASP.NET forum. I found a similar post in this forum titled "Set cursor to the end of a textbox ?????" and i think the solution could work, but I have absolutely no experience with Javascript and the solution does not explain what to do. Can someone help?
Here's my original question.
I am using a button to insert a string into a textbox on my webform. I want the cursor position to be set to the end of the inserted text so the user can continue typing without having to manually reposition the cursor.
In a VB.NET windows form i'd use...
TextBox1.Text = "Hello World"
TextBox1.Focus()
TextBox1.SelectionStart = TextBox1.Text.Length
I can insert the text and focus back onto the textbox, but when the textbox recieves focus the cursor is reset to the start of the text.
Does anyone know how i can set the cursor to the end in ASP.NET?
Thanks