watermarked asp.net form validation using jquery

syxxx

New Member
I have an asp.net form with watermarks like this:\[code\] <form id="form1" runat="server"><div class="form-inner"> <asp:TextBox ID="firstname" runat="server" value="http://stackoverflow.com/questions/12803056/First Name *" title="First Name *" class="water"></asp:TextBox> <asp:TextBox ID="lastname" runat="server" value="http://stackoverflow.com/questions/12803056/Last Name *" title="Last Name *" class="water"></asp:TextBox> <%--<input name="" value="http://stackoverflow.com/questions/12803056/Address *" title="Address *" type="text" class="water"/>--%> <asp:TextBox ID="Address" runat="server" value="http://stackoverflow.com/questions/12803056/Address *" title="Address *" class="water"></asp:TextBox> <%-- <input name="" value="http://stackoverflow.com/questions/12803056/City *" title="City *" type="text" class="water"/>--%> <asp:TextBox ID="City" runat="server" value="http://stackoverflow.com/questions/12803056/City *" title="City *" class="water"></asp:TextBox> <div> <asp:DropDownList ID="drpStates" runat="server" CssClass="inpt"> <asp:ListItem Selected="True">State*</asp:ListItem> <asp:ListItem>ACT</asp:ListItem> <asp:ListItem>NSW</asp:ListItem> <asp:ListItem>NT</asp:ListItem> <asp:ListItem>SA</asp:ListItem> <asp:ListItem>VIC</asp:ListItem> <asp:ListItem>WA</asp:ListItem> </asp:DropDownList> <%-- <input class="inpt" name="postalcode" id="postalcode" value="http://stackoverflow.com/questions/12803056/Postcode *" type="text"/>--%> <asp:TextBox ID="postalcode" runat="server" class="inpt" title="Postcode *" value="http://stackoverflow.com/questions/12803056/Postcode *"></asp:TextBox> </div> <%-- <input name="" value="http://stackoverflow.com/questions/12803056/Phone number *" title="Phone number *" type="text" class="water"/>--%> <asp:TextBox ID="txtPhoneNumber" runat="server" value="http://stackoverflow.com/questions/12803056/Phone number *" title="Phone number *" class="water"></asp:TextBox> <%-- <input name="" value="http://stackoverflow.com/questions/12803056/Email *" title="Email *" type="text" class="water"/>--%> <asp:TextBox ID="txtEmail" runat="server" value="http://stackoverflow.com/questions/12803056/Email *" title="Email *" class="water"></asp:TextBox> <div class="form-term"> <div class="chk-up"> <%--<input name="" type="checkbox" value="" />--%> <asp:CheckBox ID="chkInsurance" runat="server" Text="Yes, include my free $ 15,000 Insurance" /> </div> <div> <%--<input name="" type="checkbox" value="" checked="checked" />--%> <asp:CheckBox ID="chkNews" runat="server" Text="Yes, I would like to receive latest news" /> </div> </div> <div class="send-btn"> <%-- <a href="http://stackoverflow.com/questions/12803056/#">SEND ME A SECURE GOLD PACK</a>--%> <asp:LinkButton ID="lnkSendEmail" runat="server" OnClick="lnkSendEmail_Click">SEND ME A SECURE GOLD PACK</asp:LinkButton> </div> </div>\[/code\]and water mark code is like this:\[code\]jQuery(document).ready(function () { $(".water,.inpt").each(function () { $tb = $(this); if ($tb.val() != this.title) { $tb.removeClass("water"); } }); $(".water,.inpt").focus(function () { $tb = $(this); if ($tb.val() == this.title) { $tb.val(""); $tb.removeClass("water"); } }); $(".water,.inpt").blur(function () { $tb = $(this); if ($.trim($tb.val()) == "") { $tb.val(this.title); $tb.addClass("water"); } });}); \[/code\]I want to validate this form but due to water marks it is not being validated.I am using this plugin for validation.http://jquery.bassistance.de/validate/demo/themerollered.htmlPlease suggest me solution to it.Thanks
 
Back
Top