Click here to Skip to main content
15,883,883 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
i need this textbox text to disappear when i click on it (here is the source code for the textbox):

XML
<asp:TextBox ID="TextBox5" runat="server" Style="z-index: 116; left: 38.5%; position: absolute;
                top: 45%" Width="66px">Type Year</asp:TextBox>


any ideas ????????????????
Posted
Updated 15-Jun-11 18:08pm
v3
Comments
Sergey Alexandrovich Kryukov 15-Jun-11 16:13pm    
How can you expect any help without showing your code? Of course it can disappear, depending on what TextBox5_TextChanged does.
--SA
Abdullatif M. Abu Al Rub 16-Jun-11 3:11am    
what the hell textchanged had to do with this??
he sais he want to clear the text when clicking on it not text change!!!
Sergey Alexandrovich Kryukov 17-Jun-11 21:36pm    
It was in original version of this question, that's why.
--SA
Keith Barrow 15-Jun-11 16:52pm    
You have not provided enough information to let us help you. At least a listing of TextBox5_Changed would be a start.
charles henington 15-Jun-11 17:44pm    
or use TextBox5_Enter Event handler then on enter just set the text to String.Empty;

You can do this on the client side by handling hte focus event, and setting to "" there. You should not expect to post your random requests that you're too lazy to research for yourself, and have us do your work for you.
 
Share this answer
 
Comments
marwan93 16-Jun-11 0:08am    
how about you wise man get to business and try to solve the problem and give em some codes coz i have tried all of what you all have said (focus event,event handler,javascript codes,even ajax) nothing working or i am so stupid so i am not writing the codes right.
JV9999 16-Jun-11 2:21am    
Christian gave you as much information as you gave us, so you are not really in the position to say this to him.. Instead I would suggest you to update your question with more info on what you already tried and how you did that.



Btw: His solution is actually quite complete. Only thing missing might be a code example, but you should be able to work that out yourself. This ain't rent-a-coder.
best way to do this would be with javascript/jquery
 
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