I have a form with many fields, on order to oragnize it I decided to divide it into multiple tabs using kartik tabX. I have divide my form view into many views that I call in the tab content property. My problem is the submit button. it is not working. I think I’m putting it in the wrong way.
Here is my code:
the views:
[i][b][list=1]
[*]the tab view:
[/list][/b][/i]
<?=Html::beginForm(['bien/acquisition'],'post');?>
<?= TabsX::widget([
'position' => TabsX::POS_ABOVE,
'align' => TabsX::ALIGN_LEFT,
'encodeLabels'=>false,
'items' => [
[
'label' => 'Informations générales',
'content' => $this->render('_formInfoGeneralAcquisition', ['model' => $model,
'famille'=>$famille,
'dat'=>$dat,
'cmd'=>$cmd,
'fact'=>$fact]),
'active' => true,
],
[
'label' => 'Amortissement',
'content' => $this->render('_formAmortAcquisition', ['model' => $model,'compte'=>$compte]),
'options' => ['id' => 'myveryownID'],
],
],
]);
?>
<div class="form-group">
<?= Html::SubmitButton( 'Enregistrer bien', ['class' => 'btn btn-success', 'id'=> 'm']) ?>
</div>
<?= Html::endForm();?>
_formInfoGeneralAcquisition view (first view):
<?php $form = ActiveForm::begin(['id' => 'acquisition-form']); ?>
//My fields
<?php ActiveForm::end(); ?>
_formAmortAcquisition view (second view):
I have made the same thing for this second view.
<?php $form = ActiveForm::begin(['id' => 'acquisition-form']); ?>
//My fields
<?php ActiveForm::end(); ?>