?
Solved

to clear Textbox onclick

Posted on 2008-11-09
3
Medium Priority
?
2,120 Views
Last Modified: 2012-05-05
Hi,

I have a textbox with a value (Enter Keywords)
what I want is when the user get to the page is to see the Enter Keyword
in the textbox and when the user clickon the text box it should clear the field.

Thanks,
Here's what I have.
 
<asp:TextBox ID="TxtKeywords" onkeydown="clearInput(this);" runat="server" Text="Enter Keywords"></asp:TextBox>
 
function clearInput(obj)
{
obj.value = ""; 
}

Open in new window

0
Comment
Question by:lulu50
  • 2
3 Comments
 
LVL 4

Expert Comment

by:BToson
ID: 22916594
Hi,
Try this.  onkeydown will not work here.
<asp:TextBox on ID="TxtKeywords" runat="server" Text="Enter Keywords" onclick="this.value='';" />
0
 
LVL 4

Accepted Solution

by:
BToson earned 2000 total points
ID: 22916596
Apologies, meant this!
<asp:TextBox ID="TxtKeywords" runat="server" Text="Enter Keywords" onclick="this.value='';"></asp:TextBox>
0
 

Author Closing Comment

by:lulu50
ID: 31514828
Thank you
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Screencast - Getting to Know the Pipeline
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question