单击asp.net文本框中输入的文本末尾的按钮后控制光标

问题描述:

请帮助我.在按钮上的代码中,单击我在文本框中添加一些字符串",但是在添加字符串后,它将失去焦点,或者它不出现在该文本框中.我要在文本框中的文本后放置光标.我用过formview.我用txt.focus();

please help me. In my code on button click i add some string in textbox but after adding string it looses the focus or it not appears in that textbox. i want cursor after the text in the textbox. i used formview. i used txt.focus(); but it sets at the start of the text.

要做类似的事情应该做:
Doing something like this should do:
txt.focus();
txt.value = txt.value;



在这里,看看类似的讨论:
在文本框中设置光标位置 [ Javascript:如何将光标设置为文本框结尾 [



Here, have a look at similar discussions:
Set cursor position in TextBox[^]
Javascript: How To Set Cursor to Textbox End[^]