Click here to Skip to main content
15,888,521 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want textbox,in which already some message is present like xyz@example.com. when i click on the textbox that particular text will remove automatically
Posted
Comments
Kornfeld Eliyahu Peter 9-Aug-15 8:34am    
You should tell us the platform (web, win forms, ???) you use...
But look for 'textbox placeholder' to get some ideas...
Member 11896356 9-Aug-15 8:52am    
Visual Studio
Member 11896356 9-Aug-15 8:52am    
ASP.net

ASP.NET
<asp:TextBox ID="TextBox1" runat="server" placeholder="hi test"></asp:TextBox>

use place holder as above
 
Share this answer
 
For myself,There are two ways to show the user,what to be fill on the textbox..

1.in asp toolkit on you want the letter on the textbox asp tag add placeholder="abc@example.com" like runat="server"
Syntax:
ASP.NET
<asp:TextBox ID="txtmailid" runat="server" placeholder="abc@example.com"></asp:TextBox>


Or
2. In ajax toolkit select the textboxwatermarkextender and given the targetcontrol id="id of ur textbox" and watermarktext="abc@example.com"
ASP.NET
<asp:TextBox ID="txtmailid" runat="server"></asp:TextBox>
 <ajaxToolkit:TextBoxWatermarkExtender ID="twFname"  runat="server" TargetControlID="txtmailid" WatermarkText="abc@example.com" />

http://www.c-sharpcorner.com/uploadfile/rahul4_saxena/ajax-text-box-watermark-extender/[^]


While in ajax toolkit dont forget to paste toolscript manager or script manager..
 
Share this answer
 
v5
placeholder="Enter Name


it may help you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900