Monday, January 17, 2011

Watermark Textbox using jquery

,jHere is the coding for Watermark inside a textbox. That is initially the message will show inside the textbox. Once you click on the textbox it will disappear. This is used by jquery.

CSS:

<style type="text/css" media="screen">
.water
{
font-family: Tahoma, Arial, sans-serif; 
color: blue; 
} 
</style>

  
SCRIPT: 
  
        <script src="js/jquery-1.2.6.min.js" type="text/javascript"></script> 
  
DESIGN: 
  <div>


<h2>

Watermarked TextBox </h2>

<br />
<asp:TextBox ID="txtFirstName" class="water" Text="Enter First Name" ToolTip="Enter First Name" runat="server"></asp:TextBox><br />
<asp:TextBox ID="txtLastName" class="water" Text="Enter Last Name" ToolTip="Enter Last Name" runat="server"></asp:TextBox> <br /> 
<asp:Button ID="btnSubmit" runat="server" Text="Submit" ValidationGroup="vgNews" /></div>

0 comments:

Post a Comment

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Best Wallpapers collections