Jquery validate message disappearing in update panelhttp://forums.asp.net/t/1616557.aspx/1?Jquery+validate+message+disappearing+in+update+panelTue, 24 Apr 2012 17:12:04 -040016165574139953http://forums.asp.net/p/1616557/4139953.aspx/1?Jquery+validate+message+disappearing+in+update+panelJquery validate message disappearing in update panel <p>Hey,</p> <p>I am having an issue where i have&nbsp;fields on a form that contains an update panel that i want to do&nbsp;Jquery validation on. The issue is when i click&nbsp; the OK button, the&nbsp;validation error message appears then goes away. Looks like some post back type of issue but was wondering if someone could help. THe code is below:</p> <p>&nbsp;</p> <p>&lt;%@ Page Language=&quot;C#&quot; AutoEventWireup=&quot;true&quot; CodeFile=&quot;Default.aspx.cs&quot; Inherits=&quot;_Default&quot; %&gt;</p> <p>&lt;%@ Register Assembly=&quot;AjaxControlToolkit&quot; Namespace=&quot;AjaxControlToolkit&quot; TagPrefix=&quot;asp&quot; %&gt;</p> <p><br> &lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</a>&quot;&gt;<br> &lt;html xmlns=&quot;<a href="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</a>&quot;&gt;<br> &lt;head id=&quot;Head1&quot; runat=&quot;server&quot;&gt;<br> &lt;title&gt;Project Management System&lt;/title&gt;<br> &lt;script type=&quot;text/javascript&quot; src=&quot;<a href="http://code.jquery.com/jquery-1.4.3.js&quot;&gt;&lt;/script">&gt;<br> &lt;script type=&quot;text/javascript&quot; src=&quot;</a><a href="http://ajax.microsoft.com/ajax/jquery.validate/1.7/jquery.validate.js&quot;&gt;&lt;/script">&gt; </p> <p>&lt;/head&gt;<br> &lt;body&gt;<br> &lt;script type=&quot;text/javascript&quot;&gt;<br> &#36;(document).ready(function() {<br> &#36;(&quot;#form1&quot;).validate({<br> rules: {<br> &lt;%=txtFirstName.UniqueID %&gt;: {<br> minlength: 5,<br> required: true<br> }</p> <p>}, messages: {<br> &lt;%=txtFirstName.UniqueID %&gt;:{ <br> required: &quot;Please enter a valid username&quot;, <br> minlength: &quot;Username must be atleast 3 characters&quot; <br> } <br> }<br> });<br> });<br> &lt;/script&gt; </p> <p>&lt;form id=&quot;form1&quot; runat=&quot;server&quot;&gt;<br> &nbsp;&nbsp;&nbsp; &lt;div id=&quot;wrapper&quot;&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;div id=&quot;content&quot;&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;asp:ScriptManager ID=&quot;ScriptManager1&quot; runat=&quot;server&quot;&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/asp:ScriptManager&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;asp:UpdatePanel ID=&quot;UpdatePanel1&quot; runat=&quot;server&quot; UpdateMode=&quot;Conditional&quot; &gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ContentTemplate&gt;<br> &nbsp;&nbsp;&nbsp; <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;asp:Table ID=&quot;Table1&quot; runat=&quot;server&quot;&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;asp:TableRow Height=&quot;30&quot;&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;asp:TableCell Width=&quot;50&quot;&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;asp:Label ID=&quot;lbFirstName&quot; runat=&quot;server&quot; Text=&quot;FirstName&quot;&gt;&lt;/asp:Label&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/asp:TableCell&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;asp:TableCell Width=&quot;200&quot;&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;asp:label&gt;&lt;/asp:label&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;asp:TextBox ID=&quot;txtFirstName&quot; runat=&quot;server&quot;&gt;&lt;/asp:TextBox&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/asp:TableCell&gt;</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/asp:TableRow&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;asp:TableRow&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;asp:TableCell Width=&quot;20&quot;&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;asp:Button ID=&quot;btAddEmployee&quot; runat=&quot;server&quot; Text=&quot;Add&quot;/&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/asp:TableCell&gt; <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/asp:TableRow&gt; <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/asp:Table&gt; </p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/ContentTemplate&gt;<br> &nbsp;&nbsp;&nbsp; &lt;/asp:UpdatePanel&gt; <br> &nbsp;&nbsp;&nbsp;&nbsp; </p> <p><br> &nbsp;&nbsp;&nbsp; &lt;/div&gt; <br> &nbsp;&nbsp;&nbsp; &lt;/div&gt;<br> &lt;/form&gt;<br> &lt;/body&gt;<br> &lt;/html&gt;</p> </a> 2010-10-25T15:50:47-04:004140229http://forums.asp.net/p/1616557/4140229.aspx/1?Re+Jquery+validate+message+disappearing+in+update+panelRe: Jquery validate message disappearing in update panel <p>Try telling the Update panel to not do postbacks on it's children controls<pre class="prettyprint">&lt;asp:UpdatePanel ID=&quot;UpdatePanel1&quot; runat=&quot;server&quot; UpdateMode=&quot;Conditional&quot; ChildrenAsTriggers=&quot;false&quot; &gt;</pre><br> <br> </p> 2010-10-25T20:08:54-04:004140239http://forums.asp.net/p/1616557/4140239.aspx/1?Re+Jquery+validate+message+disappearing+in+update+panelRe: Jquery validate message disappearing in update panel <p>&nbsp;That worked.. Thanks for the quick reply</p> 2010-10-25T20:16:49-04:004949150http://forums.asp.net/p/1616557/4949150.aspx/1?Re+Jquery+validate+message+disappearing+in+update+panelRe: Jquery validate message disappearing in update panel <p>The following consistantly fixes that issue &nbsp;for me:</p> <pre class="prettyprint">&lt;asp:UpdatePanel ID=&quot;UpdatePanel1&quot; runat=&quot;server&quot; UpdateMode=&quot;Conditional&quot; ChildrenAsTriggers=&quot;false&quot; &gt;</pre> <p><br> <br> </p> 2012-04-24T17:12:04-04:00