5

I wish to create a textbox watermark without using either Ajax or JavaScript. How can I do this?

Paul Alexander
  • 31,970
  • 14
  • 96
  • 151
the_dopamine
  • 899
  • 6
  • 12
  • 21

3 Answers3

7

It is very easy. In html we can give the placeholder attribute for input elements.

e.g.

<input type="text" name="fst_name" placeholder="First Name"/>

check for more details :http://www.w3schools.com/tags/att_input_placeholder.asp

apm
  • 525
  • 6
  • 19
1

You can assign a background image with CSS like so.

textarea { 
    background-image: url(yourwatermarkimage); 
    background-attachment: scroll;
}
Loktar
  • 34,764
  • 7
  • 90
  • 104
0

I have got a dll on this site. It solved my problem http://www.dotnetcurry.com/ASPNETandjQuery/Section1-TextBox/R12-TextBoxWaterMark.aspx

Hitesh Gawhade
  • 181
  • 3
  • 7
  • 23