Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET TextBox control with label text in the background

I'm creating a login page. I want to create ASP.NET TextBox controls that have "Username" and "Password" as their Text, but as soon as they receive focus, these words should disappear and whatever the user types should appear, just like normal textbox. If the user leaves it blank and tabs to the next textbox, then these words appear again. This will eliminate the need for having separate labels in front of the text boxes. I would appreciate if someone can share their expertise for doing this.

like image 592
Shankar Avatar asked Sep 23 '08 00:09

Shankar


2 Answers

Use the TextBox Watermark Extender that's in Microsoft's AJAX Toolkit.

like image 85
phloopy Avatar answered Oct 02 '22 13:10

phloopy


Google "ASP.NET Watermark textbox". Theres a ton of implemnentations

like image 22
mattlant Avatar answered Oct 02 '22 13:10

mattlant