Default text text in Textbox in ASP.net

binay00713

Broken In
I am using asp.net (c#)
I want to to display some default text(in blur) in a textbox when the page loads like
" write here"
and when the user clicks on the textbox to write ,it should be erased automatically.
How to do it?
 

krishnandu.sarkar

Simply a DIGITian
Staff member
This is called Water Mark. Check it out *digitalbush.com/projects/watermark-input-plugin/
Your second query is also solved in that link.

Otherwise you can use Javascript onClick() event, and just clear it by document.GetElementByID("Textbox1").value = "";

But better follow the jQuery one.
 

Garbage

God of Mistakes...
One more thing you can do it set the default text as "Enter something here", and onFocus, make the text "".
 
Top Bottom