Jquery Validation?
<p>Hi there i am looping some fields with php. </p>

<pre><code>$number = 5;
for ($i = 1; $i &lt;= $number ; $i++) {
name : &lt;input name="name[]" type="text" class="required"  title="Name Surname Please"/&gt;
}
</code></pre>

<p>Am using jquery validation to control the fields,</p>

<pre><code>$("#form").validate({
        errorLabelContainer: $("#form div.error")
    });
</code></pre>

<p>but it is only validating the first field of the loop. only after clicking on the other fields the plugin works.</p>

<p>Can someone help or explain that</p>

<p>the script:</p>

<pre><code>&lt;form action="" method="post" id="form" name="form"&gt;
  &lt;table width="100%" border="0" cellspacing="5" cellpadding="0"&gt;
    &lt;?php  for ($i = 1; $i &lt;= 5; $i++) {?&gt;
    &lt;tr&gt;
      &lt;td&gt;name :
        &lt;input name="name[]" type="text" class="required"  title="Name Surname Please"/&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;?php }?&gt;
  &lt;/table&gt;
  &lt;input name="submit-form" type="submit" value="submit"/&gt;
&lt;/form&gt;
&lt;script src="/jquery.validate.js" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt; 
&lt;script type="text/javascript"&gt;

$().ready(function() {
    $("#form").validate({
        errorLabelContainer: $("#form div.error")
    });


});
&lt;/script&gt;
</code></pre>
