<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Emulate ASP.NET validation groups with jQuery validation</title>
	<atom:link href="http://encosia.com/asp-net-webforms-validation-groups-with-jquery-validation/feed/" rel="self" type="application/rss+xml" />
	<link>http://encosia.com/asp-net-webforms-validation-groups-with-jquery-validation/</link>
	<description>ASP.NET and AJAX code, ideas, and examples.</description>
	<lastBuildDate>Thu, 02 Feb 2012 19:50:46 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Chris</title>
		<link>http://encosia.com/asp-net-webforms-validation-groups-with-jquery-validation/#comment-50686</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Fri, 02 Dec 2011 00:10:15 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=948#comment-50686</guid>
		<description>Aaron, spot on, you&#039;ve just saved me hours or re-factoring the code to do just this.  Badly needed to place the submit button outside of the panel/fieldset.  

Glad I read all the replies....really nice work here all.  Keep it up...</description>
		<content:encoded><![CDATA[<p>Aaron, spot on, you&#8217;ve just saved me hours or re-factoring the code to do just this.  Badly needed to place the submit button outside of the panel/fieldset.  </p>
<p>Glad I read all the replies&#8230;.really nice work here all.  Keep it up&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Schmulik</title>
		<link>http://encosia.com/asp-net-webforms-validation-groups-with-jquery-validation/#comment-47335</link>
		<dc:creator>Schmulik</dc:creator>
		<pubDate>Mon, 14 Nov 2011 19:09:47 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=948#comment-47335</guid>
		<description>Hi!

Nice to see that this article is still helpful are so long, so thanks for that.
I was wondering if you ever implemented a way to reset validation errors only within the validationGroup? jQuery validate supports a resetForm method, but I couldn&#039;t find away to reset only a validation group.

Thanks, Schmulik.</description>
		<content:encoded><![CDATA[<p>Hi!</p>
<p>Nice to see that this article is still helpful are so long, so thanks for that.<br />
I was wondering if you ever implemented a way to reset validation errors only within the validationGroup? jQuery validate supports a resetForm method, but I couldn&#8217;t find away to reset only a validation group.</p>
<p>Thanks, Schmulik.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tristan</title>
		<link>http://encosia.com/asp-net-webforms-validation-groups-with-jquery-validation/#comment-46930</link>
		<dc:creator>Tristan</dc:creator>
		<pubDate>Tue, 25 Oct 2011 17:12:28 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=948#comment-46930</guid>
		<description>In the end, I worked around this by not using dependency callbacks at all because doing so means you run into the bug mentioned in this thread.

Instead, I completely avoided by adding new custom validators which do the same thing (probably the more correct way to implement this in any case.

So that&#039;s an additional validator like:

&lt;pre lang=&quot;javascript&quot;&gt;

jQuery.validator.addMethod(&quot;atLeastOneTelephone&quot;, function (value, element) {
    return $(&#039;.vTelephoneHome&#039;).val() != &quot;&quot; &#124;&#124; $(&#039;.vTelephoneMobile&#039;).val() != &quot;&quot;;
}, &quot;Please enter either your Home Telephone or your Mobile Telephone:&quot;);

&lt;/pre&gt;

Then you have to add the validation to the elements as normal:

&lt;pre lang=&quot;javascript&quot;&gt;

$(&#039;.vTelephoneHome&#039;).rules(&#039;add&#039;, {
        atLeastOneTelephone: true,
        messages: {
            atLeastOneTelephone: &#039;Please enter either your Home Telephone or your Mobile Telephone:&#039;
        }
    });

$(&#039;.vTelephoneMobile&#039;).rules(&#039;add&#039;, {
        atLeastOneTelephone: true,
        messages: {
            atLeastOneTelephone: &#039;&#039;
        }
    });

&lt;/pre&gt;

(The mobile validator intentionally has empty error message so you only get the error once and it&#039;s always the first one i.e. the one nearer the TelephoneHome control) 

... and just for completeness you&#039;d need to trigger the validation so it validates on keyup of either box e.g.:

&lt;pre lang=&quot;javascript&quot;&gt;

//Revalidate Telephone Mobile whenever something is entered in the Telephone Home box
    $(&#039;.vTelephoneHome&#039;).keyup(function () {
           $(&#039;.vTelephoneMobile&#039;).valid();
    });

//Revalidate Telephone Home whenever something is entered in the Telephone Mobile box
    $(&#039;.vTelephoneMobile&#039;).keyup(function () {
            $(&#039;.vTelephoneHome&#039;).valid();
    });

&lt;/pre&gt;

So in short, avoid this bug by keeping as far away from it as possible and not using the dependency callback for the required validtion methos</description>
		<content:encoded><![CDATA[<p>In the end, I worked around this by not using dependency callbacks at all because doing so means you run into the bug mentioned in this thread.</p>
<p>Instead, I completely avoided by adding new custom validators which do the same thing (probably the more correct way to implement this in any case.</p>
<p>So that&#8217;s an additional validator like:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&nbsp;
jQuery.<span style="color: #660066;">validator</span>.<span style="color: #660066;">addMethod</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;atLeastOneTelephone&quot;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>value<span style="color: #339933;">,</span> element<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">return</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.vTelephoneHome'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #3366CC;">&quot;&quot;</span> <span style="color: #339933;">||</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.vTelephoneMobile'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;Please enter either your Home Telephone or your Mobile Telephone:&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Then you have to add the validation to the elements as normal:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&nbsp;
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.vTelephoneHome'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">rules</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'add'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>
        atLeastOneTelephone<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>
        messages<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
            atLeastOneTelephone<span style="color: #339933;">:</span> <span style="color: #3366CC;">'Please enter either your Home Telephone or your Mobile Telephone:'</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.vTelephoneMobile'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">rules</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'add'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>
        atLeastOneTelephone<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>
        messages<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
            atLeastOneTelephone<span style="color: #339933;">:</span> <span style="color: #3366CC;">''</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>(The mobile validator intentionally has empty error message so you only get the error once and it&#8217;s always the first one i.e. the one nearer the TelephoneHome control) </p>
<p>&#8230; and just for completeness you&#8217;d need to trigger the validation so it validates on keyup of either box e.g.:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&nbsp;
<span style="color: #006600; font-style: italic;">//Revalidate Telephone Mobile whenever something is entered in the Telephone Home box</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.vTelephoneHome'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">keyup</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
           $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.vTelephoneMobile'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">valid</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">//Revalidate Telephone Home whenever something is entered in the Telephone Mobile box</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.vTelephoneMobile'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">keyup</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.vTelephoneHome'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">valid</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>So in short, avoid this bug by keeping as far away from it as possible and not using the dependency callback for the required validtion methos</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: alkos333</title>
		<link>http://encosia.com/asp-net-webforms-validation-groups-with-jquery-validation/#comment-46928</link>
		<dc:creator>alkos333</dc:creator>
		<pubDate>Tue, 25 Oct 2011 17:01:07 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=948#comment-46928</guid>
		<description>I believe I commented on this above on &quot;12:02 pm - June 9, 2011&quot;.  Do an in-page search on that exact time stamp string and you&#039;ll find my reply.

Hope that helps.</description>
		<content:encoded><![CDATA[<p>I believe I commented on this above on &#8220;12:02 pm &#8211; June 9, 2011&#8243;.  Do an in-page search on that exact time stamp string and you&#8217;ll find my reply.</p>
<p>Hope that helps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tristan</title>
		<link>http://encosia.com/asp-net-webforms-validation-groups-with-jquery-validation/#comment-46915</link>
		<dc:creator>Tristan</dc:creator>
		<pubDate>Tue, 25 Oct 2011 10:24:20 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=948#comment-46915</guid>
		<description>I ran into this bug for a slightly different reason: 2 telephone number fields where either one is required, but not both. Hence the custom dependency callbacks e.g.:

&lt;pre lang=&quot;javascript&quot;&gt;

//Telephone Home validation
    $(&#039;.vTelephoneHome&#039;).rules(&#039;add&#039;, {
        required: function (element) {
            return $(&#039;.vTelephoneHome&#039;).val() == &quot;&quot; &amp;&amp; $(&#039;.vTelephoneMobile&#039;).val() == &quot;&quot;;
        },
        messages: {
            required: &#039;Please enter either your Home Telephone or your Mobile Telephone&#039;
        }
    });

&lt;/pre&gt;

When coupled with the same call back for the mobile telephone and some additional logic to make these re-validate on keyup of either box, this works perfectly but ONLY for the dynamic validation (e.g. form submitted with no telephone numbers and then telephone numbers entered so error messages appear and disappear as they should).

The problem comes with when you actually submit the form. The following code is the problem:

&lt;pre lang=&quot;javascript&quot;&gt;

    $group.find(&#039;:input&#039;).each(function (i, item) {
        if (!$(item).valid())
            isValid = false;
    });

&lt;/pre&gt;

Because $(item).valid() returns false (not valid) for the $(&#039;.vTelephoneHome&#039;) element, even when the callback function returns false (i.e. the field should NOT be required).

Peter&#039;s solution above would not work because items are only &#039;required&#039; under certain circumstances and to my knowledge don&#039;t get given the required class dynamically.

I&#039;m looking at a pretty hacky work around on this at the moment, but I just wondered if anybody had found a more elegant and fix-all workaround to this bug.</description>
		<content:encoded><![CDATA[<p>I ran into this bug for a slightly different reason: 2 telephone number fields where either one is required, but not both. Hence the custom dependency callbacks e.g.:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&nbsp;
<span style="color: #006600; font-style: italic;">//Telephone Home validation</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.vTelephoneHome'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">rules</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'add'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>
        required<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>element<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">return</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.vTelephoneHome'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;&quot;</span> <span style="color: #339933;">&amp;&amp;</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.vTelephoneMobile'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
        messages<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
            required<span style="color: #339933;">:</span> <span style="color: #3366CC;">'Please enter either your Home Telephone or your Mobile Telephone'</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>When coupled with the same call back for the mobile telephone and some additional logic to make these re-validate on keyup of either box, this works perfectly but ONLY for the dynamic validation (e.g. form submitted with no telephone numbers and then telephone numbers entered so error messages appear and disappear as they should).</p>
<p>The problem comes with when you actually submit the form. The following code is the problem:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&nbsp;
    $group.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">':input'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>i<span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">item</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">item</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">valid</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
            isValid <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Because $(item).valid() returns false (not valid) for the $(&#8216;.vTelephoneHome&#8217;) element, even when the callback function returns false (i.e. the field should NOT be required).</p>
<p>Peter&#8217;s solution above would not work because items are only &#8216;required&#8217; under certain circumstances and to my knowledge don&#8217;t get given the required class dynamically.</p>
<p>I&#8217;m looking at a pretty hacky work around on this at the moment, but I just wondered if anybody had found a more elegant and fix-all workaround to this bug.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom</title>
		<link>http://encosia.com/asp-net-webforms-validation-groups-with-jquery-validation/#comment-46236</link>
		<dc:creator>Tom</dc:creator>
		<pubDate>Mon, 03 Oct 2011 11:06:24 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=948#comment-46236</guid>
		<description>This article helped me out so much - thank you.;</description>
		<content:encoded><![CDATA[<p>This article helped me out so much &#8211; thank you.;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam</title>
		<link>http://encosia.com/asp-net-webforms-validation-groups-with-jquery-validation/#comment-45135</link>
		<dc:creator>Adam</dc:creator>
		<pubDate>Sun, 28 Aug 2011 12:35:40 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=948#comment-45135</guid>
		<description>How do I add click events to each of the submit buttons?</description>
		<content:encoded><![CDATA[<p>How do I add click events to each of the submit buttons?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Graham</title>
		<link>http://encosia.com/asp-net-webforms-validation-groups-with-jquery-validation/#comment-44649</link>
		<dc:creator>Graham</dc:creator>
		<pubDate>Thu, 11 Aug 2011 21:02:29 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=948#comment-44649</guid>
		<description>Excellent article and a great help!  I was nearing the end of a project and dreading implementing a tonne of ASP.NET validation controls.  This really makes the whole thing so quick and simple to implement, thank you!</description>
		<content:encoded><![CDATA[<p>Excellent article and a great help!  I was nearing the end of a project and dreading implementing a tonne of ASP.NET validation controls.  This really makes the whole thing so quick and simple to implement, thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Ward</title>
		<link>http://encosia.com/asp-net-webforms-validation-groups-with-jquery-validation/#comment-44574</link>
		<dc:creator>Dave Ward</dc:creator>
		<pubDate>Mon, 08 Aug 2011 07:50:44 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=948#comment-44574</guid>
		<description>This should work fine in tabs. Make sure none of your selectors are excluding the elements you want to validate.</description>
		<content:encoded><![CDATA[<p>This should work fine in tabs. Make sure none of your selectors are excluding the elements you want to validate.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shajahan</title>
		<link>http://encosia.com/asp-net-webforms-validation-groups-with-jquery-validation/#comment-44553</link>
		<dc:creator>shajahan</dc:creator>
		<pubDate>Sat, 06 Aug 2011 04:21:02 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=948#comment-44553</guid>
		<description>Hi Dev thanks for quick reply, i want one more help in this scenario. I&#039;m using jquery tab menu and using user controls containing textboxes, dropdownlist,et..
inside each tab. when I&#039;m using this type of validation its working only in the first tab and remaining tabs are submitting without validation.I&#039;m expecting a best solution from you. Thanks in advance :)</description>
		<content:encoded><![CDATA[<p>Hi Dev thanks for quick reply, i want one more help in this scenario. I&#8217;m using jquery tab menu and using user controls containing textboxes, dropdownlist,et..<br />
inside each tab. when I&#8217;m using this type of validation its working only in the first tab and remaining tabs are submitting without validation.I&#8217;m expecting a best solution from you. Thanks in advance :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Ward</title>
		<link>http://encosia.com/asp-net-webforms-validation-groups-with-jquery-validation/#comment-44544</link>
		<dc:creator>Dave Ward</dc:creator>
		<pubDate>Fri, 05 Aug 2011 15:17:15 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=948#comment-44544</guid>
		<description>You can combine rules defined in the .validate constructor with rules declared via CSS classes. So, you could add a minlength validation to the example in this post, for example:

&lt;pre lang=&quot;javascript&quot;&gt;// Initialize validation on the entire ASP.NET form.
$(&quot;#form1&quot;).validate({
  // This prevents validation from running on every
  //  form submission by default.
  onsubmit: false,
  // You can also mix in more complex validation rules:
  rules: {
    Zip: {
      minlength: 5
    }
  }
});&lt;/pre&gt;

I updated &lt;a href=&quot;https://github.com/Encosia/Encosia-Samples-WebForms-jQuery-Validation/tree/42fc105951e38cfca3077f79bf9d3bff7d3128e0&quot; rel=&quot;nofollow&quot;&gt;the example code on GitHub with an example of that&lt;/a&gt;, if you want to look at a working example.</description>
		<content:encoded><![CDATA[<p>You can combine rules defined in the .validate constructor with rules declared via CSS classes. So, you could add a minlength validation to the example in this post, for example:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// Initialize validation on the entire ASP.NET form.</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#form1&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">validate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #006600; font-style: italic;">// This prevents validation from running on every</span>
  <span style="color: #006600; font-style: italic;">//  form submission by default.</span>
  onsubmit<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span>
  <span style="color: #006600; font-style: italic;">// You can also mix in more complex validation rules:</span>
  rules<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
    Zip<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
      minlength<span style="color: #339933;">:</span> <span style="color: #CC0000;">5</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>I updated <a href="https://github.com/Encosia/Encosia-Samples-WebForms-jQuery-Validation/tree/42fc105951e38cfca3077f79bf9d3bff7d3128e0" rel="nofollow">the example code on GitHub with an example of that</a>, if you want to look at a working example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shajahan</title>
		<link>http://encosia.com/asp-net-webforms-validation-groups-with-jquery-validation/#comment-44536</link>
		<dc:creator>shajahan</dc:creator>
		<pubDate>Fri, 05 Aug 2011 09:47:16 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=948#comment-44536</guid>
		<description>First of all i thanking you for a wonder full solution. I&#039;m searching for one of this article a while.As I was previously using the jquery validation with rules and it works on my webforms but I was struggling with validation with multiple forms due to a few pop up windows I have on Masterpage. Now with your code, multiple forms works but validation rules like minlength , equalTo no longer works. Only the basic rules like required, email and digits works. Could you please double check on this or update your sample source code with these rules examples. I’m sure this nice solution of yours can benefits thousands out there. Once again, thanks for sharing such a wonderful solution :)</description>
		<content:encoded><![CDATA[<p>First of all i thanking you for a wonder full solution. I&#8217;m searching for one of this article a while.As I was previously using the jquery validation with rules and it works on my webforms but I was struggling with validation with multiple forms due to a few pop up windows I have on Masterpage. Now with your code, multiple forms works but validation rules like minlength , equalTo no longer works. Only the basic rules like required, email and digits works. Could you please double check on this or update your sample source code with these rules examples. I’m sure this nice solution of yours can benefits thousands out there. Once again, thanks for sharing such a wonderful solution :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: alkos333</title>
		<link>http://encosia.com/asp-net-webforms-validation-groups-with-jquery-validation/#comment-44100</link>
		<dc:creator>alkos333</dc:creator>
		<pubDate>Fri, 24 Jun 2011 14:37:54 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=948#comment-44100</guid>
		<description>Ah ... my tags got taken out of the post. Here&#039;s the paragraph with the tags I was referring to:

Now, the intricacy of using JQuery UI dialog is that by default it takes the wrapped dialog out of the &lt;pre lang=&quot;html&quot;&gt;&lt;form&gt;&lt;/form&gt;&lt;/pre&gt; since it’s appended before the &lt;pre lang=&quot;html&quot;&gt;&lt;/body&gt;&lt;/pre&gt; tag. This is a problem as jquery-validation plugin relies on elements being inside the &lt;pre lang=&quot;html&quot;&gt;&lt;form&gt;&lt;/form&gt;&lt;/pre&gt; or they will not get validated.

To mitigate this issue, make sure to place the dialog inside the form when you open it:</description>
		<content:encoded><![CDATA[<p>Ah &#8230; my tags got taken out of the post. Here&#8217;s the paragraph with the tags I was referring to:</p>
<p>Now, the intricacy of using JQuery UI dialog is that by default it takes the wrapped dialog out of the</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"><span style="color: #009900;">&lt;form&gt;&lt;<span style="color: #66cc66;">/</span>form&gt;</span></pre></div></div>

<p> since it’s appended before the</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/body&gt;</span></span></pre></div></div>

<p> tag. This is a problem as jquery-validation plugin relies on elements being inside the</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"><span style="color: #009900;">&lt;form&gt;&lt;<span style="color: #66cc66;">/</span>form&gt;</span></pre></div></div>

<p> or they will not get validated.</p>
<p>To mitigate this issue, make sure to place the dialog inside the form when you open it:</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: alkos333</title>
		<link>http://encosia.com/asp-net-webforms-validation-groups-with-jquery-validation/#comment-44098</link>
		<dc:creator>alkos333</dc:creator>
		<pubDate>Fri, 24 Jun 2011 14:32:12 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=948#comment-44098</guid>
		<description>You would define your .validationGroup(s) where needed, including the #dialog  div that will be wrapped by jQuery UI.  Also, keep in mind that the validation is triggered by elements which have .causesValidation class, so your JQuery UI dialog button will need to have this class if you want the elements inside the dialog to be validated before closing it for instance.

Now, the intricacy of using JQuery UI dialog is that by default it takes the wrapped dialog out of the  since it&#039;s appended before the  tag.  This is a problem as jquery-validation plugin relies on elements being inside the  or they will not get validated.

To mitigate this issue, make sure to place the dialog inside the  when you open it:

&lt;pre lang=&quot;javascript&quot;&gt;$mydialog.dialog(&quot;open&quot;).parent().appendTo(&quot;form&quot;)&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>You would define your .validationGroup(s) where needed, including the #dialog  div that will be wrapped by jQuery UI.  Also, keep in mind that the validation is triggered by elements which have .causesValidation class, so your JQuery UI dialog button will need to have this class if you want the elements inside the dialog to be validated before closing it for instance.</p>
<p>Now, the intricacy of using JQuery UI dialog is that by default it takes the wrapped dialog out of the  since it&#8217;s appended before the  tag.  This is a problem as jquery-validation plugin relies on elements being inside the  or they will not get validated.</p>
<p>To mitigate this issue, make sure to place the dialog inside the  when you open it:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$mydialog.<span style="color: #660066;">dialog</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;open&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">appendTo</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;form&quot;</span><span style="color: #009900;">&#41;</span></pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://encosia.com/asp-net-webforms-validation-groups-with-jquery-validation/#comment-44088</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Fri, 24 Jun 2011 08:46:11 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=948#comment-44088</guid>
		<description>Thanks for the very informative article Dave. Can you advice how to implement this functionality while using a jQuery UI modal dialog ?</description>
		<content:encoded><![CDATA[<p>Thanks for the very informative article Dave. Can you advice how to implement this functionality while using a jQuery UI modal dialog ?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

