Form and TabView

Hello again

Now I have a question with forms and CTabView

I have the following create view:



<div class="yiiForm">





<?php echo CHtml::form(); ?>





<?php echo CHtml::errorSummary($estimate); ?>


<?php echo CHtml::errorSummary($repetition); ?>





<div class="simple">


<?php echo CHtml::activeLabelEx($estimate,'description'); ?>


<?php echo CHtml::activeTextField($estimate,'description',array('size'=>60,'maxlength'=>255)); ?>


</div>


<div class="simple">


<?php echo CHtml::activeLabelEx($estimate,'cash'); ?>


<?php echo CHtml::activeTextField($estimate,'cash',array('size'=>10,'maxlength'=>10)); ?>


</div>


<hr />


<h3>Repetition</h3>


<?php


	$Tabs = array(


		'UNIQUE'=>array('title'=>'Unique','view'=>'/repetition/_formUnique'),


		'YEAR'=>array('title'=>'Year','view'=>'/repetition/_formYear'),


		'MOTH'=>array('title'=>'Month','view'=>'/repetition/_formMonth'),


		'WEEK'=>array('title'=>'Week','view'=>'/repetition/_formWeek'),


		'DAILY'=>array('title'=>'Daily','view'=>'/repetition/_formDaily'),


		'DAY'=>array('title'=>'Day','view'=>'/repetition/_formDay') 


	);


	


	$viewData = array('repetition'=>$repetition);


	


	$this->widget('CTabView', array('tabs'=>$Tabs, 'viewData'=>$viewData));


?>


<hr />


<div class="action">


<?php echo CHtml::submitButton('Save'); ?> <?php echo CHtml::resetButton('Reset'); ?>


</div>





<?php echo CHtml::closeTag('form'); ?>


</div><!-- yiiForm -->





Each one of '/repetition/_formUnique', '/repetition/_formYear', etc, are different (the ask for different thinks for $repetition, or in some different way).

Now: How can I ask in my controller wich one of the tabs is the one selected at submit time?

So in my actionCreate I can validate just the $repetition depending on the selected tab.

All works fine, except that point, that I don't know how know the selected tab.

You can place a hidden field in each tab.

Each tab has already many fields.

For example, _formYear just a field (the year), _formMont (the initial month, and number indicating the periodicity), etc.

Each tab differnet information related to a $repetition.

But I dont want to save all the information (or validate all the information), just the information of the selected tab. this is my problem…

The tab indicates (in screen) what type of repetition I must save.

Each type save different things (so each _formXXX show the needed).

Sorry the late reply, I have so much work now…

yes, that's what I meant: using a hidden field to store the tab name (each tab has its own hidden field). So when a tab is submitted, you can read which is submitted by reading this hidden field.