Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Cjuitabs And Form Validation Issue

$
0
0
Hi,

I am facing form validation issue with CJuiTabs. I have 4 tabs all render form elements from different models. I have submit button in my tabs view. below is the code which renders forms:
<?php $form=$this->beginWidget('CActiveForm', array(
'id'=>'default-parent-form',
'enableAjaxValidation'=>false,
'htmlOptions' => array('enctype' => 'multipart/form-data'),
)); ?>

<?php
$tabs = array();

$tabs['Agent Details'] = array(
'id'=>'dataAgentTab',
'content'=>$this->renderPartial('_formAgentFields', array(
'form' => $form,
'agent_model'=>$agent_model,
),
true),
);

$tabs['Users'] = array(
'id'=>'dataUserTab',
'content'=>$this->renderPartial('_formUserFields', array(
'form' => $form,
'user_model'=>$user_model,
),
true),
);

$tabs['Bank Details'] = array(
'id'=>'dataBankTab',
'content'=>$this->renderPartial('_formBankFields', array(
'form' => $form,
'bank_model'=>$bank_model,
),
true),
);

$tabs['Travel Association'] = array(
'id'=>'dataTravelTab',
'content'=>$this->renderPartial('_formTravelFields', array(
'form' => $form,
'travel_model'=>$travel_model,
),
true),
);

$this->widget('zii.widgets.jui.CJuiTabs', array(
'tabs' => $tabs,
'options' => array(
'collapsible' => false,
),
));
?>
<div class="row buttons">
<?php echo CHtml::submitButton($agent_model->isNewRecord ? 'Create' : 'Save'); ?>
</div>

<?php $this->endWidget(); ?>

All respective models define rules(). When i submit form only fields from first tab ie AgentNew gets validated. Fields from other tabs dont get validated. Pl help.

Viewing all articles
Browse latest Browse all 18717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>