Blank a textbox when selected

  • Thread starter Thread starter MattB
  • Start date Start date
M

MattB

I've been to sites that have a textbox with text in it until you tab
into it or click on it and then the text disappears. I'd like to do that
with a password field in my project. I imagine I'd need to do it with
Javascript, which I'm not very experienced with. Does anyone have or
know of any examples of this I could look at? Thanks!

Matt
 
Do this in page load

if not ispostback
textbox1.attributes.add("OnFocus","this.value='';")

that should do it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top