Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot


Reply
 
LinkBack Thread Tools Display Modes
Old 22-04-2011, 05:07 PM   #1 (permalink)
Right Off the Assembly Line
 
Join Date: Apr 2011
Location: BBSR, Orissa
Posts: 34
Default Default text text in Textbox in ASP.net


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?
binay00713 is offline   Reply With Quote
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 22-04-2011, 08:20 PM   #2 (permalink)
Simply a DIGITian
 
krishnandu.sarkar's Avatar
 
Join Date: Nov 2007
Location: Kolkata
Posts: 2,942
Default Re: Default text text in Textbox in ASP.net

This is called Water Mark. Check it out http://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.
__________________
  • Read The Forum RULES First.
  • Before PM'ing Or Asking Any Questions To Any Mod Read The FAQ's
  • Before Starting A New Thread Read The STICKY THREADS First
  • Before Participating In Bazaar Section Read The BAZAAR RULES
krishnandu.sarkar is online now   Reply With Quote
Old 22-04-2011, 09:41 PM   #3 (permalink)
God of Mistakes...
 
Garbage's Avatar
 
Join Date: Dec 2005
Location: Pune, Maharashtra
Posts: 1,923
Default Re: Default text text in Textbox in ASP.net

One more thing you can do it set the default text as "Enter something here", and onFocus, make the text "".
__________________
Registered Linux User #468778
----------------------------------
http://twitter.com/_Garbage_
Garbage is offline   Reply With Quote
Old 22-04-2011, 10:02 PM   #4 (permalink)
Simply a DIGITian
 
krishnandu.sarkar's Avatar
 
Join Date: Nov 2007
Location: Kolkata
Posts: 2,942
Default Re: Default text text in Textbox in ASP.net

Quote:
Originally Posted by Garbage View Post
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.
__________________
  • Read The Forum RULES First.
  • Before PM'ing Or Asking Any Questions To Any Mod Read The FAQ's
  • Before Starting A New Thread Read The STICKY THREADS First
  • Before Participating In Bazaar Section Read The BAZAAR RULES
krishnandu.sarkar is online now   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


 
Latest Threads
- by Charan
- by Sarath
- by clmlbx

Advertisement




All times are GMT +5.5. The time now is 12:26 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2