单击asp.net文本框中输入的文本末尾的按钮后控制光标 [英] controlling cursor after clicking on button at the end of the text entered in textbox in asp.net

查看:101
本文介绍了单击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[^]


这篇关于单击asp.net文本框中输入的文本末尾的按钮后控制光标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆