DIGIT-ARC read-only archive · snapshot: July 23, 2026

Default text text in Textbox in ASP.net

4 posts · originally from https://geek.digit.in/community/threads/default-text-text-in-textbox-in-asp-net.139646/

B
binay00713 Original post #1
Apr 22, 2011 at 5:07 PM
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
Apr 22, 2011 at 8:20 PM
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
Garbage #3
Apr 22, 2011 at 9:41 PM
One more thing you can do it set the default text as "Enter something here", and onFocus, make the text "".
krishnandu.sarkar
Apr 22, 2011 at 10:02 PM
One more thing you can do it set the default text as "Enter something here", and onFocus, make the text "".

Ya, but he wants the default text to be greyed out. Like our TDF "Forum Search" box.