How To Validate Textfield Array

Good afternoon,

I have a tabular form with a field like this:

<?php  for($i = 1; $i<=3; $i++): ?>

 <div class="col-md-12">

                   <?php echo $form->textField($model,'pergunta[]',array('maxlength'=>105));  ?>

                     <?php echo $form->error($model, 'pergunta[]'); ?>


<?php endfor; ?>

How do I validate this field with ajax?

this code not working.



I am sure this code will never get validated… because u have not used your index $i in your code… then how in your controller you will fetch those values for validation…

Please check that :)