<?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: jQuery plugin: Validation</title>
	<atom:link href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/feed/" rel="self" type="application/rss+xml" />
	<link>http://bassistance.de</link>
	<description>Jörn Zaefferer on Bass, Geeks and Rock'n'Roll</description>
	<lastBuildDate>Fri, 19 Mar 2010 14:33:55 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Jörn</title>
		<link>http://bassistance.de/jquery-plugins/jquery-plugin-validation/comment-page-12/#comment-86858</link>
		<dc:creator>Jörn</dc:creator>
		<pubDate>Sun, 20 Jan 2008 13:27:42 +0000</pubDate>
		<guid isPermaLink="false">http://bassistance.de/jquery-plugins/jquery-plugin-validation/#comment-86858</guid>
		<description>Comments here are now closed.

&lt;ul&gt;
	&lt;li&gt;Please post questions to the &lt;a href=&quot;http://groups.google.com/group/jquery-en&quot; rel=&quot;nofollow&quot;&gt;jQuery discussion list&lt;/a&gt;, putting (validate) into the subject of your post, making it easier to spot it and respond quickly.&lt;/li&gt;
	&lt;li&gt;Please post bug reports and other contributions (enhancements, features, eg. new validation methods) to the &lt;a href=&quot;http://dev.jquery.com/newticket&quot; rel=&quot;nofollow&quot;&gt;jQuery bug tracker&lt;/a&gt; (requires &lt;a href=&quot;http://dev.jquery.com/register&quot; rel=&quot;nofollow&quot;&gt;registration&lt;/a&gt;). Please put [validate] into the title of a ticket.&lt;/li&gt;
&lt;/ul&gt;</description>
		<content:encoded><![CDATA[<p>Comments here are now closed.</p>
<ul>
<li>Please post questions to the <a href="http://groups.google.com/group/jquery-en" rel="nofollow">jQuery discussion list</a>, putting (validate) into the subject of your post, making it easier to spot it and respond quickly.</li>
<li>Please post bug reports and other contributions (enhancements, features, eg. new validation methods) to the <a href="http://dev.jquery.com/newticket" rel="nofollow">jQuery bug tracker</a> (requires <a href="http://dev.jquery.com/register" rel="nofollow">registration</a>). Please put [validate] into the title of a ticket.</li>
</ul>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jörn</title>
		<link>http://bassistance.de/jquery-plugins/jquery-plugin-validation/comment-page-12/#comment-86854</link>
		<dc:creator>Jörn</dc:creator>
		<pubDate>Sun, 20 Jan 2008 13:17:30 +0000</pubDate>
		<guid isPermaLink="false">http://bassistance.de/jquery-plugins/jquery-plugin-validation/#comment-86854</guid>
		<description>Sorry for not responding here for quite some time. The comment system just doesn&#039;t scale for that many comments. I&#039;ll respond to each one since my last respnd, then shut down comments here and add pointers to future support forms. Thanks!

All answers below will assume the 1.2 release, please upgrade if you haven&#039;t already.

@Olin: You can manually validate a form using the &lt;a href=&quot;http://docs.jquery.com/Plugins/Validation/valid&quot;&gt;valid()&lt;/a&gt; on the form, as long as you init the validation before that. Give this a try:

&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;$(&quot;#myform&quot;).validate();
$(&quot;img.submit&quot;).click(function() {
  if ($(&quot;#myform&quot;).valid() ) {
    // do something cool when the form is valid
  }
});&lt;/code&gt;&lt;/pre&gt;

@David: The validation 1.2 creates only a single validator for a given form, no matter how often you call validate(). That should fix the basic problem you describe.

@Erick: You should implement your own custom method which checks for whitespace in the filename. See &lt;a href=&quot;http://docs.jquery.com/Plugins/Validation/Validator/addMethod#namemethodmessage&quot;&gt;$.validator.addMethod&lt;/a&gt; for details.

@Howa: Enhancing error messages with animations is something I&#039;ll try to tackle in 1.3, among other issue in that area. Animations work only on block elements, so the form layout must be optimized to support animations.

@gabe: Yes, and there is an example showing how to implement it. See the &lt;a href=&quot;http://dev.jquery.com/view/trunk/plugins/validate/demo/dynamic-totals.html&quot;&gt;dynamic inputs example&lt;/a&gt;. In that case it checks that a group of field doesn&#039;t sum up over a certain total value.

@Laurent: Right, either customize error placement, or place the label in the form beforehand. You can hide it via CSS and the validation plugin picks it up and displays it.

For &quot;array notation&quot; you need to use quotes, eg. &quot;bla[]&quot;: &quot;required&quot;.

@zeek: 1.2 features a complete overhaul of the email method, as well as the URL method.

@Sheldon: Displaying messages outside the form (still) isn&#039;t supported. &quot;Finding&quot; error elements depends on field-names, which are only unique inside a given form. I&#039;ll try to tackle that in 1.3.

For displaying general messages you should use the errorContainer option of the validate method.

@robert: There are problems with tabs, right, I haven&#039;t yet tried to tackle them, but will in 1.3.

@Marvin: Validating dynamic elements is very easy in 1.2, you just need to find a neat way to create the elements and add them to the form, everything else works out-of-the-box. See the &lt;a href=&quot;http://dev.jquery.com/view/trunk/plugins/validate/demo/dynamic-totals.html&quot;&gt;dynamic inputs example&lt;/a&gt;.

@palPalani: The provided date validations are not capable of doing that, you&#039;d have to implement your own birth-date-validation. The &lt;a href=&quot;http://www.datejs.com/&quot;&gt;dateJS library&lt;/a&gt; may be helpful for that.

@John: Nope, title doesn&#039;t support multiple entries. Functions in the class attribute should work as long as you escape quotes properly. class=&quot;{bblabl:&quot;flafl&quot;}&quot; won&#039;t work. Use single quotes instead: class=&quot;{blaba:&#039;flfa&#039;}&quot;.

@Marcos Aurélio: Please give the remote validation in 1.2 a try. Its now complete and tested.

@Robert: The regexes for email and url are completely replaced in 1.2.

@Andreas R: Fixed!

@mykle: Drupal 6 includes jQuery 1.2.x, so once that is available... The validation 1.2 release doesn&#039;t require the metadata plugin anymore for inline-rules, but requires 1.2.2+ nonetheless. Keeping compability with older version isn&#039;t worth it from my perspective, sooner or later everyone should be able to upgrade to current jQuery versions.

@Vishal: Doing animations only on blur isn&#039;t possible yet. I&#039;m going to work on better support for animations in 1.3.

@chadi: Currently you&#039;ve got to check for existance of the form before calling validate. As long as you call that when the form actually exists everything should work fine.

@Adisonz: The 1.2 release contains a lot of improvements to support dynamic forms. Please give it a try.

@Jamie Jensen: The easiest approach would be to place the designated error message element in the form and hide it via CSS. The validation plugin will look for the element and show it accordingly.

@Felix: Remote validation is now stable. Did you take a look at the &lt;a href=&quot;http://dev.jquery.com/view/trunk/plugins/validate/demo/ajaxSubmit-intergration-demo.html&quot;&gt;ajaxSubmit-demo&lt;/a&gt;?

@Peter: True, that is a flaw in the validation plugin. That validate method breaks the usual plugin model in other aspects, too. I&#039;m planning to fix these in the 2.0 release, which will break a lot of compability while cleaning up a lot of mistakes of the past. Until then you&#039;ve got to make sure that the form exists before calling validate.

@Leigh Dodds: Please give the 1.2 release a try, it contains a lot of improvements for dynamic forms. The refresh() method is gone as there is no need to call it anymore.

@SubOne: For the validation to work you&#039;d have to change the name of the cloned fields. I&#039;ll try to figure out a way to validate fields with xxx[] names, as that is too common in PHP land.

@Eric Wahlforss: The second issue is easy to resolve by using the success-option, please take a look at the &lt;a href=&quot;http://docs.jquery.com/Plugins/Validation/validate&quot;&gt;docs for validate()&lt;/a&gt;. That&#039;ll work for remote checks, too.

The first issue was a bug, thanks for reporting. The fix is included in the final 1.2 release.

@SubOne: That change looks like it supresses the symptom, but doesn&#039;t actually fixes the issue. Could you provide some feedback about the actual issue, eg. a testpage?</description>
		<content:encoded><![CDATA[<p>Sorry for not responding here for quite some time. The comment system just doesn&#8217;t scale for that many comments. I&#8217;ll respond to each one since my last respnd, then shut down comments here and add pointers to future support forms. Thanks!</p>
<p>All answers below will assume the 1.2 release, please upgrade if you haven&#8217;t already.</p>
<p>@Olin: You can manually validate a form using the <a href="http://docs.jquery.com/Plugins/Validation/valid">valid()</a> on the form, as long as you init the validation before that. Give this a try:</p>
<pre><code class="javascript">$("#myform").validate();
$("img.submit").click(function() {
  if ($("#myform").valid() ) {
    // do something cool when the form is valid
  }
});</code></pre>
<p>@David: The validation 1.2 creates only a single validator for a given form, no matter how often you call validate(). That should fix the basic problem you describe.</p>
<p>@Erick: You should implement your own custom method which checks for whitespace in the filename. See <a href="http://docs.jquery.com/Plugins/Validation/Validator/addMethod#namemethodmessage">$.validator.addMethod</a> for details.</p>
<p>@Howa: Enhancing error messages with animations is something I&#8217;ll try to tackle in 1.3, among other issue in that area. Animations work only on block elements, so the form layout must be optimized to support animations.</p>
<p>@gabe: Yes, and there is an example showing how to implement it. See the <a href="http://dev.jquery.com/view/trunk/plugins/validate/demo/dynamic-totals.html">dynamic inputs example</a>. In that case it checks that a group of field doesn&#8217;t sum up over a certain total value.</p>
<p>@Laurent: Right, either customize error placement, or place the label in the form beforehand. You can hide it via CSS and the validation plugin picks it up and displays it.</p>
<p>For &#8220;array notation&#8221; you need to use quotes, eg. &#8220;bla[]&#8220;: &#8220;required&#8221;.</p>
<p>@zeek: 1.2 features a complete overhaul of the email method, as well as the URL method.</p>
<p>@Sheldon: Displaying messages outside the form (still) isn&#8217;t supported. &#8220;Finding&#8221; error elements depends on field-names, which are only unique inside a given form. I&#8217;ll try to tackle that in 1.3.</p>
<p>For displaying general messages you should use the errorContainer option of the validate method.</p>
<p>@robert: There are problems with tabs, right, I haven&#8217;t yet tried to tackle them, but will in 1.3.</p>
<p>@Marvin: Validating dynamic elements is very easy in 1.2, you just need to find a neat way to create the elements and add them to the form, everything else works out-of-the-box. See the <a href="http://dev.jquery.com/view/trunk/plugins/validate/demo/dynamic-totals.html">dynamic inputs example</a>.</p>
<p>@palPalani: The provided date validations are not capable of doing that, you&#8217;d have to implement your own birth-date-validation. The <a href="http://www.datejs.com/">dateJS library</a> may be helpful for that.</p>
<p>@John: Nope, title doesn&#8217;t support multiple entries. Functions in the class attribute should work as long as you escape quotes properly. class=&#8221;{bblabl:&#8221;flafl&#8221;}&#8221; won&#8217;t work. Use single quotes instead: class=&#8221;{blaba:&#8217;flfa&#8217;}&#8221;.</p>
<p>@Marcos Aurélio: Please give the remote validation in 1.2 a try. Its now complete and tested.</p>
<p>@Robert: The regexes for email and url are completely replaced in 1.2.</p>
<p>@Andreas R: Fixed!</p>
<p>@mykle: Drupal 6 includes jQuery 1.2.x, so once that is available&#8230; The validation 1.2 release doesn&#8217;t require the metadata plugin anymore for inline-rules, but requires 1.2.2+ nonetheless. Keeping compability with older version isn&#8217;t worth it from my perspective, sooner or later everyone should be able to upgrade to current jQuery versions.</p>
<p>@Vishal: Doing animations only on blur isn&#8217;t possible yet. I&#8217;m going to work on better support for animations in 1.3.</p>
<p>@chadi: Currently you&#8217;ve got to check for existance of the form before calling validate. As long as you call that when the form actually exists everything should work fine.</p>
<p>@Adisonz: The 1.2 release contains a lot of improvements to support dynamic forms. Please give it a try.</p>
<p>@Jamie Jensen: The easiest approach would be to place the designated error message element in the form and hide it via CSS. The validation plugin will look for the element and show it accordingly.</p>
<p>@Felix: Remote validation is now stable. Did you take a look at the <a href="http://dev.jquery.com/view/trunk/plugins/validate/demo/ajaxSubmit-intergration-demo.html">ajaxSubmit-demo</a>?</p>
<p>@Peter: True, that is a flaw in the validation plugin. That validate method breaks the usual plugin model in other aspects, too. I&#8217;m planning to fix these in the 2.0 release, which will break a lot of compability while cleaning up a lot of mistakes of the past. Until then you&#8217;ve got to make sure that the form exists before calling validate.</p>
<p>@Leigh Dodds: Please give the 1.2 release a try, it contains a lot of improvements for dynamic forms. The refresh() method is gone as there is no need to call it anymore.</p>
<p>@SubOne: For the validation to work you&#8217;d have to change the name of the cloned fields. I&#8217;ll try to figure out a way to validate fields with xxx[] names, as that is too common in PHP land.</p>
<p>@Eric Wahlforss: The second issue is easy to resolve by using the success-option, please take a look at the <a href="http://docs.jquery.com/Plugins/Validation/validate">docs for validate()</a>. That&#8217;ll work for remote checks, too.</p>
<p>The first issue was a bug, thanks for reporting. The fix is included in the final 1.2 release.</p>
<p>@SubOne: That change looks like it supresses the symptom, but doesn&#8217;t actually fixes the issue. Could you provide some feedback about the actual issue, eg. a testpage?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yuval</title>
		<link>http://bassistance.de/jquery-plugins/jquery-plugin-validation/comment-page-12/#comment-86594</link>
		<dc:creator>Yuval</dc:creator>
		<pubDate>Sun, 20 Jan 2008 00:55:57 +0000</pubDate>
		<guid isPermaLink="false">http://bassistance.de/jquery-plugins/jquery-plugin-validation/#comment-86594</guid>
		<description>Hey Jörn,
I was trying to implement the latest revision of the validation plugin but it did not work. So I followed all of the revisions and realized that my form stops working right between revisions 4325 and 4329 (meaning 4325 is the latest revision that worked for me).
I tried doing a comparison (http://dev.jquery.com/changeset?new=4329%40trunk%2Fplugins%2Fvalidate%2Fjquery.validate.js&amp;old=4325%40trunk%2Fplugins%2Fvalidate%2Fjquery.validate.js) between the two but no luck. What could it possibly be?
Thank you,
Yuval</description>
		<content:encoded><![CDATA[<p>Hey Jörn,<br />
I was trying to implement the latest revision of the validation plugin but it did not work. So I followed all of the revisions and realized that my form stops working right between revisions 4325 and 4329 (meaning 4325 is the latest revision that worked for me).<br />
I tried doing a comparison (<a href="http://dev.jquery.com/changeset?new=4329%40trunk%2Fplugins%2Fvalidate%2Fjquery.validate.js&amp;old=4325%40trunk%2Fplugins%2Fvalidate%2Fjquery.validate.js" rel="nofollow">http://dev.jquery.com/changeset?new=4329%40trunk%2Fplugins%2Fvalidate%2Fjquery.validate.js&amp;old=4325%40trunk%2Fplugins%2Fvalidate%2Fjquery.validate.js</a>) between the two but no luck. What could it possibly be?<br />
Thank you,<br />
Yuval</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SubOne</title>
		<link>http://bassistance.de/jquery-plugins/jquery-plugin-validation/comment-page-12/#comment-85517</link>
		<dc:creator>SubOne</dc:creator>
		<pubDate>Fri, 18 Jan 2008 19:46:26 +0000</pubDate>
		<guid isPermaLink="false">http://bassistance.de/jquery-plugins/jquery-plugin-validation/#comment-85517</guid>
		<description>That last post reminds me I made an edit to your code:

&lt;code&gt;if ( !this.depend(param, element) )&lt;/code&gt;
changed to:
&lt;code&gt;if ( !this.depend &#124;&#124; !this.depend(param, element) )&lt;/code&gt;

I was getting an error that this.depend was not a function and it was making the rest of the validation fail.</description>
		<content:encoded><![CDATA[<p>That last post reminds me I made an edit to your code:</p>
<p><code>if ( !this.depend(param, element) )</code><br />
changed to:<br />
<code>if ( !this.depend || !this.depend(param, element) )</code></p>
<p>I was getting an error that this.depend was not a function and it was making the rest of the validation fail.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Wahlforss</title>
		<link>http://bassistance.de/jquery-plugins/jquery-plugin-validation/comment-page-12/#comment-85347</link>
		<dc:creator>Eric Wahlforss</dc:creator>
		<pubDate>Fri, 18 Jan 2008 16:12:19 +0000</pubDate>
		<guid isPermaLink="false">http://bassistance.de/jquery-plugins/jquery-plugin-validation/#comment-85347</guid>
		<description>Hi again,
regarding 2) above this only fails on fields that are checked with ajax.

cheers // eric</description>
		<content:encoded><![CDATA[<p>Hi again,<br />
regarding 2) above this only fails on fields that are checked with ajax.</p>
<p>cheers // eric</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Wahlforss</title>
		<link>http://bassistance.de/jquery-plugins/jquery-plugin-validation/comment-page-12/#comment-85205</link>
		<dc:creator>Eric Wahlforss</dc:creator>
		<pubDate>Fri, 18 Jan 2008 12:23:31 +0000</pubDate>
		<guid isPermaLink="false">http://bassistance.de/jquery-plugins/jquery-plugin-validation/#comment-85205</guid>
		<description>hi,
I just got ajax validation to work on our site using the latest FC1 of jquery.validate(). Brilliant stuff!

I&#039;ve run into two glitches this far:

1) Every now and then the form submit button won&#039;t work although all fields in the form are valid, this happens a lot when I use ajax fields (that check for unique email/username, etc).

2) I&#039;ve tried to make small script for highlighting fields (displaying a checkbox mark as user feedback) for valid fields. It looks something like this:

      var username = $(&quot;#user_username&quot;);
      username.blur(function(){
          if (validator.element(username)) {
            username.addClass(&#039;valid&#039;);
          }
      });

Unfortunately the validator.element function returns undefined every now and then, so I cannot really use this. Is there another way of doing this? What I basically want to do is assign a &quot;valid&quot; class on blur to form fields that are valid.

Here&#039;s my form code:
http://pastie.caboo.se/140481

Thanks for a great plugin! // eric</description>
		<content:encoded><![CDATA[<p>hi,<br />
I just got ajax validation to work on our site using the latest FC1 of jquery.validate(). Brilliant stuff!</p>
<p>I&#8217;ve run into two glitches this far:</p>
<p>1) Every now and then the form submit button won&#8217;t work although all fields in the form are valid, this happens a lot when I use ajax fields (that check for unique email/username, etc).</p>
<p>2) I&#8217;ve tried to make small script for highlighting fields (displaying a checkbox mark as user feedback) for valid fields. It looks something like this:</p>
<p>      var username = $(&#8220;#user_username&#8221;);<br />
      username.blur(function(){<br />
          if (validator.element(username)) {<br />
            username.addClass(&#8216;valid&#8217;);<br />
          }<br />
      });</p>
<p>Unfortunately the validator.element function returns undefined every now and then, so I cannot really use this. Is there another way of doing this? What I basically want to do is assign a &#8220;valid&#8221; class on blur to form fields that are valid.</p>
<p>Here&#8217;s my form code:<br />
<a href="http://pastie.caboo.se/140481" rel="nofollow">http://pastie.caboo.se/140481</a></p>
<p>Thanks for a great plugin! // eric</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SubOne</title>
		<link>http://bassistance.de/jquery-plugins/jquery-plugin-validation/comment-page-12/#comment-84552</link>
		<dc:creator>SubOne</dc:creator>
		<pubDate>Thu, 17 Jan 2008 17:42:54 +0000</pubDate>
		<guid isPermaLink="false">http://bassistance.de/jquery-plugins/jquery-plugin-validation/#comment-84552</guid>
		<description>I am trying to use this plugin with a control array, but I can&#039;t seem to get it working. The way I have it setup is something like:

&lt;code&gt;
&lt;form id=&quot;reg1Form&quot; class=&quot;pretty&quot; method=&quot;post&quot; action=&quot;&quot;&gt;
  &lt;fieldset id=&quot;badge&quot;&gt;
    &lt;legend&gt;Your Registration Information&lt;/legend&gt;
    &lt;ol&gt;
      &lt;li&gt;
        &lt;label for=&quot;register_name[]&quot; class=&quot;required&quot;&gt;Full Name:&lt;/label&gt;
        &lt;input type=&quot;text&quot; name=&quot;register_name[]&quot; class=&quot;medium&quot; maxlength=&quot;32&quot; /&gt;
        &lt;span class=&quot;tip&quot;&gt;First then last (e.g. John Doe)&lt;/span&gt;
      &lt;/li&gt;
    &lt;/ol&gt;
  &lt;/fieldset&gt;
  &lt;input type=&quot;button&quot; id=&quot;register_add_guest&quot; name=&quot;register_add_guest&quot; onclick=&quot;addGuest();&quot; class=&quot;addguest&quot; value=&quot;Add Guest&quot;&gt;
  &lt;input type=&quot;submit&quot; name=&quot;register_submit&quot; class=&quot;nextstep&quot; value=&quot;Next Step&quot;&gt;
&lt;/form&gt;
&lt;/code&gt;

Now validation works fine at this point until I click &quot;Add Guest&quot;, which closes the &quot;badge&quot; fieldset and inserts it before the buttons. After the clone I have this in the code:

&lt;code&gt;
&lt;form id=&quot;reg1Form&quot; class=&quot;pretty&quot; method=&quot;post&quot; action=&quot;&quot;&gt;
  &lt;fieldset id=&quot;badge&quot;&gt;
    &lt;legend&gt;Your Registration Information&lt;/legend&gt;
    &lt;ol&gt;
      &lt;li&gt;
        &lt;label for=&quot;register_name[]&quot; class=&quot;required&quot;&gt;Full Name:&lt;/label&gt;
        &lt;input type=&quot;text&quot; name=&quot;register_name[]&quot; class=&quot;medium&quot; maxlength=&quot;32&quot; /&gt;
        &lt;span class=&quot;tip&quot;&gt;First then last (e.g. John Doe)&lt;/span&gt;
      &lt;/li&gt;
    &lt;/ol&gt;
  &lt;/fieldset&gt;
  &lt;fieldset id=&quot;badge1&quot;&gt;
    &lt;legend&gt;Guest #1 Registration Information&lt;/legend&gt;
    &lt;ol&gt;
      &lt;li&gt;
        &lt;label for=&quot;register_name[]&quot; class=&quot;required&quot;&gt;Full Name:&lt;/label&gt;
        &lt;input type=&quot;text&quot; name=&quot;register_name[]&quot; class=&quot;medium&quot; maxlength=&quot;32&quot; /&gt;
        &lt;span class=&quot;tip&quot;&gt;First then last (e.g. John Doe)&lt;/span&gt;
      &lt;/li&gt;
    &lt;/ol&gt;
  &lt;/fieldset&gt;
  &lt;input type=&quot;button&quot; id=&quot;register_add_guest&quot; name=&quot;register_add_guest&quot; onclick=&quot;addGuest();&quot; class=&quot;addguest&quot; value=&quot;Add Guest&quot;&gt;
  &lt;input type=&quot;submit&quot; name=&quot;register_submit&quot; class=&quot;nextstep&quot; value=&quot;Next Step&quot;&gt;
&lt;/form&gt;
&lt;/code&gt;

But now the first fieldset is the only one being validated. The user can click &quot;Add Guest&quot; as many times as they want as well as remove individual fieldsets if they decide they no longer need them. However, I can&#039;t get the form to validate the dynamically added fields.

Any help with this would be greatly appreciated.</description>
		<content:encoded><![CDATA[<p>I am trying to use this plugin with a control array, but I can&#8217;t seem to get it working. The way I have it setup is something like:</p>
<p><code><br />
&lt;form id="reg1Form" class="pretty" method="post" action=""&gt;<br />
  &lt;fieldset id="badge"&gt;<br />
    &lt;legend&gt;Your Registration Information&lt;/legend&gt;<br />
    &lt;ol&gt;<br />
      &lt;li&gt;<br />
        &lt;label for="register_name[]" class="required"&gt;Full Name:&lt;/label&gt;<br />
        &lt;input type="text" name="register_name[]" class="medium" maxlength="32" /&gt;<br />
        &lt;span class="tip"&gt;First then last (e.g. John Doe)&lt;/span&gt;<br />
      &lt;/li&gt;<br />
    &lt;/ol&gt;<br />
  &lt;/fieldset&gt;<br />
  &lt;input type="button" id="register_add_guest" name="register_add_guest" onclick="addGuest();" class="addguest" value="Add Guest"&gt;<br />
  &lt;input type="submit" name="register_submit" class="nextstep" value="Next Step"&gt;<br />
&lt;/form&gt;<br />
</code></p>
<p>Now validation works fine at this point until I click &#8220;Add Guest&#8221;, which closes the &#8220;badge&#8221; fieldset and inserts it before the buttons. After the clone I have this in the code:</p>
<p><code><br />
&lt;form id="reg1Form" class="pretty" method="post" action=""&gt;<br />
  &lt;fieldset id="badge"&gt;<br />
    &lt;legend&gt;Your Registration Information&lt;/legend&gt;<br />
    &lt;ol&gt;<br />
      &lt;li&gt;<br />
        &lt;label for="register_name[]" class="required"&gt;Full Name:&lt;/label&gt;<br />
        &lt;input type="text" name="register_name[]" class="medium" maxlength="32" /&gt;<br />
        &lt;span class="tip"&gt;First then last (e.g. John Doe)&lt;/span&gt;<br />
      &lt;/li&gt;<br />
    &lt;/ol&gt;<br />
  &lt;/fieldset&gt;<br />
  &lt;fieldset id="badge1"&gt;<br />
    &lt;legend&gt;Guest #1 Registration Information&lt;/legend&gt;<br />
    &lt;ol&gt;<br />
      &lt;li&gt;<br />
        &lt;label for="register_name[]" class="required"&gt;Full Name:&lt;/label&gt;<br />
        &lt;input type="text" name="register_name[]" class="medium" maxlength="32" /&gt;<br />
        &lt;span class="tip"&gt;First then last (e.g. John Doe)&lt;/span&gt;<br />
      &lt;/li&gt;<br />
    &lt;/ol&gt;<br />
  &lt;/fieldset&gt;<br />
  &lt;input type="button" id="register_add_guest" name="register_add_guest" onclick="addGuest();" class="addguest" value="Add Guest"&gt;<br />
  &lt;input type="submit" name="register_submit" class="nextstep" value="Next Step"&gt;<br />
&lt;/form&gt;<br />
</code></p>
<p>But now the first fieldset is the only one being validated. The user can click &#8220;Add Guest&#8221; as many times as they want as well as remove individual fieldsets if they decide they no longer need them. However, I can&#8217;t get the form to validate the dynamically added fields.</p>
<p>Any help with this would be greatly appreciated.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Leigh Dodds</title>
		<link>http://bassistance.de/jquery-plugins/jquery-plugin-validation/comment-page-12/#comment-84419</link>
		<dc:creator>Leigh Dodds</dc:creator>
		<pubDate>Thu, 17 Jan 2008 13:42:17 +0000</pubDate>
		<guid isPermaLink="false">http://bassistance.de/jquery-plugins/jquery-plugin-validation/#comment-84419</guid>
		<description>Hi,

I&#039;m trying to work out how to apply validation to a form that allows users to dynamically add and remove elements. To achieve this I&#039;m just using the JQuery clone method.

The fields added to the form are &quot;required&quot;, but the validation doesn&#039;t seem to want to apply to the newly added fields. In fact it seems to be validating the originally cloned field instead.

Looking at the comments on this page I think I need to be using the refresh() method but this isn&#039;t documented, and seems to have been removed from the most recent code: the dynamic totals example doesn&#039;t seem to use it either. 

Is there some documentation or a simple example of this somewhere?</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I&#8217;m trying to work out how to apply validation to a form that allows users to dynamically add and remove elements. To achieve this I&#8217;m just using the JQuery clone method.</p>
<p>The fields added to the form are &#8220;required&#8221;, but the validation doesn&#8217;t seem to want to apply to the newly added fields. In fact it seems to be validating the originally cloned field instead.</p>
<p>Looking at the comments on this page I think I need to be using the refresh() method but this isn&#8217;t documented, and seems to have been removed from the most recent code: the dynamic totals example doesn&#8217;t seem to use it either. </p>
<p>Is there some documentation or a simple example of this somewhere?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jamie Jensen</title>
		<link>http://bassistance.de/jquery-plugins/jquery-plugin-validation/comment-page-12/#comment-84200</link>
		<dc:creator>Jamie Jensen</dc:creator>
		<pubDate>Thu, 17 Jan 2008 08:04:03 +0000</pubDate>
		<guid isPermaLink="false">http://bassistance.de/jquery-plugins/jquery-plugin-validation/#comment-84200</guid>
		<description>err... proving my point ? *shrugs*

original...
&lt;code&gt;cc_state: {
  required: function() { 
    return ($j(&#039;div#billing_cc&#039;).css(&#039;display&#039;) != &#039;none&#039;);{
  required: function() {
    return $j(&quot;#cc_state&quot;).val() !== &#039;Select a State&#039;;    
  }
},&lt;/code&gt;

changed and working ...

&lt;code&gt;cc_state: {
  required: function() { 
    return ($j(&#039;div#billing_cc&#039;).css(&#039;display&#039;) != &#039;none&#039;); {
      required: function() {
        return $j(&quot;#cc_state&quot;).val() !== &#039;Select a State&#039;;
      }
    }
  }
},&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>err&#8230; proving my point ? *shrugs*</p>
<p>original&#8230;<br />
&lt;code&gt;cc_state: {<br />
  required: function() {<br />
    return ($j(&#8216;div#billing_cc&#8217;).css(&#8216;display&#8217;) != &#8216;none&#8217;);{<br />
  required: function() {<br />
    return $j(&#8220;#cc_state&#8221;).val() !== &#8216;Select a State&#8217;;<br />
  }<br />
},&lt;/code&gt;</p>
<p>changed and working &#8230;</p>
<p>&lt;code&gt;cc_state: {<br />
  required: function() {<br />
    return ($j(&#8216;div#billing_cc&#8217;).css(&#8216;display&#8217;) != &#8216;none&#8217;); {<br />
      required: function() {<br />
        return $j(&#8220;#cc_state&#8221;).val() !== &#8216;Select a State&#8217;;<br />
      }<br />
    }<br />
  }<br />
},&lt;/code&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jamie Jensen</title>
		<link>http://bassistance.de/jquery-plugins/jquery-plugin-validation/comment-page-12/#comment-84198</link>
		<dc:creator>Jamie Jensen</dc:creator>
		<pubDate>Thu, 17 Jan 2008 07:58:03 +0000</pubDate>
		<guid isPermaLink="false">http://bassistance.de/jquery-plugins/jquery-plugin-validation/#comment-84198</guid>
		<description>ok, so maybe I am just lazy and not stupid?  I&#039;ll leave that to the reader to decide.

The validation problem in my second question was caused by improper placement of the function? The required portion of the validation process.

I had ... 
&lt;code&gt;cc_state: {
  required: function() { 
    return ($j(&#039;div#billing_cc&#039;).css(&#039;display&#039;) != &#039;none&#039;);
  }
  required: function() {
    return $j(&quot;#cc_state&quot;).val() !== &#039;Select a State&#039;;    
  }
},&lt;/code&gt;

Which cause the required component of the field to always be checked.

I changed it to ... 
&lt;code&gt;cc_state: {
  required: function() { 
    return ($j(&#039;div#billing_cc&#039;).css(&#039;display&#039;) != &#039;none&#039;);
  }
  required: function() {
    return $j(&quot;#cc_state&quot;).val() !== &#039;Select a State&#039;;    
  }
},&lt;/code&gt; 

and it worked properly.

I am checking 9 fields, is there a better way to make my code block a bit smalled and more efficient?

Thanks,

Jamie Jensen</description>
		<content:encoded><![CDATA[<p>ok, so maybe I am just lazy and not stupid?  I&#8217;ll leave that to the reader to decide.</p>
<p>The validation problem in my second question was caused by improper placement of the function? The required portion of the validation process.</p>
<p>I had &#8230;<br />
<code>cc_state: {<br />
  required: function() {<br />
    return ($j('div#billing_cc').css('display') != 'none');<br />
  }<br />
  required: function() {<br />
    return $j("#cc_state").val() !== 'Select a State';<br />
  }<br />
},</code></p>
<p>Which cause the required component of the field to always be checked.</p>
<p>I changed it to &#8230;<br />
<code>cc_state: {<br />
  required: function() {<br />
    return ($j('div#billing_cc').css('display') != 'none');<br />
  }<br />
  required: function() {<br />
    return $j("#cc_state").val() !== 'Select a State';<br />
  }<br />
},</code> </p>
<p>and it worked properly.</p>
<p>I am checking 9 fields, is there a better way to make my code block a bit smalled and more efficient?</p>
<p>Thanks,</p>
<p>Jamie Jensen</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic page generated in 0.267 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2010-03-21 04:18:15 -->
