Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TextBox with Default value

I want to use a textbox that shows a text.

For example : [email protected]. When the user clicks on it, the textbox is cleared and ready for the user to type.

sample textbox

like image 877
Mojtaba Avatar asked Feb 17 '23 23:02

Mojtaba


1 Answers

If you are working on newer browsers then you can use placeholder property which is new in HTML 5

<asp:TextBox ID="textBox1" runat="server" placeholder="[email protected]"></asp:TextBox>

otherwise you can also use onfocus and onblur event to do this as described here

like image 167
Sachin Avatar answered Mar 04 '23 05:03

Sachin