用户单击以输入数据时,从文本框中清除文本 [英] Clearing text from text box when user clicks it to enter data

查看:91
本文介绍了用户单击以输入数据时,从文本框中清除文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!

我的.aspx页面中有一个文本框.

Hi all!

I have a Textbox in my .aspx page.

<asp:TextBox ID="txtCurrentLoc" runat="server" EnableViewState="False" Text="Location"

>


我想做的就是在用户单击输入内容后立即清除文本.


What I want to do is to clear the text as soon as the user clicks it to enter value.

推荐答案

解决方案数量 ^ ].在此处的另一讨论 [
Number of solutions here[^]. Another discussion on this here[^].


您可以将ajax用于此类工作

对于文本框,有一个名为"watermarkextender"的扩展程序控件,您可以使用此
you can use ajax for such type of work

there is an extender control called "watermarkextender " for textbox you can use this


用户的Placeholder 属性.唯一的问题是您不支持IE,但是我很确定它是HTML5功能.
User the Placeholder attribute which. Only problem is that you don''t support IE, but I''m pretty sure it''s a HTML5 feature.


这篇关于用户单击以输入数据时,从文本框中清除文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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