lulu50
asked on
to clear Textbox onclick
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,
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 = "";
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you
Try this. onkeydown will not work here.
<asp:TextBox on ID="TxtKeywords" runat="server" Text="Enter Keywords" onclick="this.value='';" />