title: yii validate an input array of phone numbers
body: <p>I'm working on a multiple contact form in Yii 1.1.16. Where the user can add multiple phone numbers.</p>
  
  <p>Problem is, how would i validate this using Yii's <code>rules()</code>?</p>
  
  <pre><code>&lt;div class="form-group"&gt;
                  &lt;?php 
                  echo $form-&gt;labelEx($model,'contacts', array('class'=&gt;'col-md-3 control-label')); 
                  ?&gt;
                    &lt;div class="col-md-9"&gt;
                      &lt;div class="multiple-contact multiple-form-group input-group padding-bottom-10px" data-max="5"&gt;
                              &lt;div class="input-group-btn input-group-select"&gt;
                                  &lt;button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"&gt;
                                      &lt;span class="concept"&gt;Phone&lt;/span&gt; &lt;i class="fa fa-caret-down"&gt;&lt;/i&gt;
                                  &lt;/button&gt;
                                  &lt;ul class="dropdown-menu" role="menu"&gt;
                                      &lt;li&gt;&lt;a href="#phone"&gt;Phone&lt;/a&gt;&lt;/li&gt;
                                      &lt;li&gt;&lt;a href="#fax"&gt;Fax&lt;/a&gt;&lt;/li&gt;
                                      &lt;li&gt;&lt;a href="#mobile"&gt;Mobile&lt;/a&gt;&lt;/li&gt;
                                  &lt;/ul&gt;
                                  &lt;?php echo $form-&gt;textField($model,'contacts',array('type'=&gt;'text', 'class'=&gt;'input-group-select-val', 'name'=&gt;'contacts[type][]','value'=&gt;'phone')); ?&gt;
                              &lt;/div&gt;
  
                              &lt;?php echo $form-&gt;textField($model,'contacts',array('size'=&gt;60,'maxlength'=&gt;255, 'name'=&gt;'contacts[value][]','class'=&gt;'form-control')); ?&gt;
                              &lt;?php echo $form-&gt;error($model,'contacts'); ?&gt;
                              &lt;span class="input-group-btn"&gt;
                                  &lt;button type="button" class="btn btn-success btn-add"&gt;&lt;i class="fa fa-plus"&gt;&lt;/i&gt;&lt;/button&gt;
                              &lt;/span&gt;
                     &lt;/div&gt;
                   &lt;/div&gt;
              &lt;/div&gt;
  </code></pre>
  
  <p>i tried using this, but doesn't work</p>
  
  <pre><code>public function rules()
  {
          return array(
      array('contacts[value][]', 'required'),
      array('contacts[value][]', 'integerOnly'=&gt;true),
      array('contacts[value][]','type','type'=&gt;'array','allowEmpty'=&gt;false)
      );
  }
  </code></pre>
  
  <p>Here is a sample <a href="http://jsfiddle.net/5c6fqyg6/" rel="nofollow">Fiddle</a> on how the jQuery side works. I want it to be able to validate with <code>'enableAjaxValidation'=&gt;true,</code>. Also, when more fields are added, it duplicates the <code>id</code> of the input. and no ajax post is done <code>onblur/onfocus</code></p>