How to change text in textbox when it is clicked?

Posted 09 March 2010 - 09:01 PM

hi,

i have a username and password textbox. they start off saying username and password in a grey text. what i want to happen is when the user clicks in them the text in them disappears and the user can type in them, however if they are clicked out of before anything is typed the original text reappears. also in the username textbox i want the text that the user types in to be black, and in the password textbox i want the password circles to appear when the user types in their password.

for an example i want them to work exactly like the email and password textboxes on facebook.

Re: How to change text in textbox when it is clicked?

Posted 09 March 2010 - 09:48 PM

the only thing is its an asp.net application, and when i click for the list of events it only has has a few of the events that are there on a windows form application (Enter is not there). instead of clicking on Enter from the list of events, will it work if i just type it in in source code.

sorry if i sound stupid and/or not making sense first time ive messed with an asp.net app, and little programming experience period.

Re: How to change text in textbox when it is clicked?

Posted 10 March 2010 - 01:51 PM

Thanks alot man! I just have 2 more questions. I want the text in the watermark to be light grey. i saw on the link you gave me, he gave his a colored background, but i think he used a CSS sheet for that. Is there an easier way i can do that in VS? I tried typing in the hexidecimal next to the watermartk text property, but it didnt work. also for my password textbox, how can i make it so dots show up?

Re: How to change text in textbox when it is clicked?

Posted 10 March 2010 - 03:12 PM

I will take that back. I would assume it's possible using Javascript. You can use javascript to determine when the textbox has focus, and then set the textbox's TextMode to password. I only assume this is possible. I have NOT done this myself.