Hi!
here is my situation:
form is generated by this code:
<div class="form">
<?php $form=$this->beginWidget('CActiveForm',array(
'id'=>'upload-form',
'enableAjaxValidation'=>true,
'clientOptions' => array(
'validateOnSubmit' => false,
'validateOnChange' => false,
),
)); ?>
<?php
$i=0;
foreach($files as $value=>$key){
echo $this->renderPartial('_form',array(
'i'=>$i,
'form'=>$form,
'songs'=>$songs,
'files'=>$files[$i]
));
$i=$i+1;
}
?>
<p class="note">Fields with <span class="required">*</span> are required.</p>
<?php //echo CHtml::errorSummary(array($songs,$album,$group,$tag)); ?>
<div class="row submit">
<?php echo CHtml::submitButton('submit'); ?>
</div>
<?php $this->endWidget(); ?>
</div><!-- form -->
</form>
Here is the result:
<div class="form">
<form id="upload-form" action="/music/index.php?r=upload/edit" method="post">
<div class="row">
<label for="Songs_song_name" class="required">Song Name <span class="required">*</span></label> <input class="required" size="60" maxlength="40" name="Songs[0][song_name]" id="Songs_0_song_name" type="text" />
////////////////////////
<div class="row">
<label for="Songs_song_name" class="required">Song Name <span class="required">*</span></label> <input class="required" size="60" maxlength="40" name="Songs[1][song_name]" id="Songs_1_song_name" type="text" />
////////////////////////
<p class="note">Fields with <span class="required">*</span> are required.</p>
<div class="row submit">
<input type="submit" name="yt0" value="submit" />
</div>
</form>
</div><!-- form -->
</form>
How do i make AjaxValidation work in such conditions?
Thanks!