YiiBooster how to make a button add a row on the next line

921 Views Asked by At

Hello everyone.

I have a view file, in which there is an inline form with three text inputs and one button. I need to generate three same inputs and a button on the next line when clicking on this button.

Please help.

Here's the code:

<?php $form=$this->beginWidget('bootstrap.widgets.TbActiveForm',array(
    'id'=>'warehouse-form',
    'type' => 'inline',
    'enableAjaxValidation'=>true,
)); ?>

<?php echo $form->errorSummary($model); ?>

    <?php echo $form->textFieldRow($model,'productName',array('class'=>'span3','maxlength'=>255)); ?>

    <?php echo $form->textFieldRow($model,'cost',array('class'=>'span3')); ?>

    <?php echo $form->textFieldRow($model,'imported_at',array('class'=>'span3')); ?>

    <?php $this->widget('bootstrap.widgets.TbButton', array(
        'label' => 'One more',
        'size' => 'mini'
    )); ?>

<div class="form-actions">
    <?php $this->widget('bootstrap.widgets.TbButton', array(
            'buttonType'=>'submit',
            'type'=>'primary',
            'label'=>$model->isNewRecord ? 'Create' : 'Save',
        )); ?>
</div>

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

P.S. Sorry for my poor english.

0

There are 0 best solutions below