Show Text in TextBox after Load and Hide after Mouse Over

14 Jun

<asp:Panel ID=”pnlNewsLetter” DefaultButton=”submit” runat=”server”>
<asp:TextBox ID=”txtEmail” runat=”server” Text=”Enter your email”  CssClass=”input” onfocus=”if(this.value==’Enter your email’)this.value=”;” onblur=”if(this.value==”)this.value=’Enter your email’;” onmouseover=”if(this.value==’Enter your email’)this.value=”;” onmouseout=”if(this.value==”)this.value=’Enter your email’;”></asp:TextBox>
<asp:regularexpressionvalidator runat=”server” SetFocusOnError=”true” id=”val26″ ValidationGroup=”NewsLetter” ControlToValidate=”txtEmail” ValidationExpression=”^([a-zA-Z0-9_\-])([a-zA-Z0-9_\-\.]*)@(\[((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}|((([a-zA-Z0-9\-]+)\.)+))([a-zA-Z]{2,}|(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\])$” ErrorMessage=”Email Address is not valid” Display=”none” />
<asp:Label ID=”lbl_Sub” runat=”server”></asp:Label>
<asp:Button ID=”submit” runat=”server” Text=””  ValidationGroup=”NewsLetter”/>
<asp:validationsummary ValidationGroup=”NewsLetter” Visible=”True” id=”valSummary” runat=”server” ShowSummary=”False” DisplayMode=”BulletList” ShowMessageBox=”True” HeaderText=”” />



1 Comment

Posted by on June 14, 2011 in Others



One response to “Show Text in TextBox after Load and Hide after Mouse Over

  1. ram

    September 16, 2011 at 7:59 am



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: