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

325

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.

People are also looking for solutions to the problem: php - mysql select query very slow when using where clause

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.