vbnewbie01
asked on
clear textbox/fill textbox
hi there; using asp.net 2.0 (vb), i have the following textbox with default text displaying.
<asp:TextBox ID="txtTextbox" Text="Enter Name" onclick="txtTextbox.value ='';" AutoComplete="off" MaxLength="120" runat="server"></asp:TextB ox>
when the user clicks inside the textbox, the default disappears. what i would like to add is if the user clicks outside of the textbox without adding anything, the default text reappears.
suggestions? thanks all.
<asp:TextBox ID="txtTextbox" Text="Enter Name" onclick="txtTextbox.value ='';" AutoComplete="off" MaxLength="120" runat="server"></asp:TextB
when the user clicks inside the textbox, the default disappears. what i would like to add is if the user clicks outside of the textbox without adding anything, the default text reappears.
suggestions? thanks all.
txtTextbox.Attributes.Add( "onfocus", "if(this.value.toLowerCase () == 'enter name') this.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
thanks, Chandan_Gowda. right idea but not quite what i was looking for. b0lsc0tt; exactly what i needed. forgot about the onblur .... been awhile since i played with javascript (c:
thanks again, guys.
thanks again, guys.
Your welcome! I'm glad I could help. Thanks for the grade, the points and the fun question.
bol
bol
TextBox1.Attributes.Add("o