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.
 
Back
Top