2 InputText in one row

Hi,

I use bootstrap and I want put 2 InputText in one row.

Email in first line

F_name and L_name in second line…

Like this:

I use yii2 and my code is like this:


<?php


use yii\helpers\Html;

//use yii\widgets\ActiveForm;

use yii\helpers\ArrayHelper;

use yii\jui\DatePicker;

use yii\bootstrap\ActiveForm;


?>


<div class="form_a-form">


    <?php $form = ActiveForm::begin(); ?>




    <?= $form->field($model, 'email', [

		'template' => '{label} <div class="row"><div class="col-sm-2">{input}{error}{hint}</div></div>'

   

     ])->textInput(['maxlength' => true]) ?>


    <?= $form->field($model, 'f_name', [

        'template' => '{label} <div class="row"><div class="col-sm-2">{input}{error}{hint}</div></div>'

 

     ])->textInput(['maxlength' => true]) ?>


    <?= $form->field($model, 'l_name', [

		'template' => '{label} <div class="row"><div class="col-sm-2">{input}{error}{hint}</div></div>'

   

    ])->textInput(['maxlength' => true]) ?>




    .....






Thx for help.

Hi,

I think it’s more of a bootstrap questions than a yii question. Here’s how I would do it


<div class="row">

   <?= $form->field($model, 'email') ?>

</div>    


<div class="row">

   <div class="col-md-6">

      <?= $form->field($model, 'f_name') ?>

   </div>

   <div class="col-md-6">

      <?= $form->field($model, 'l_name') ?>

   </div>

</div>


<div class="row">

   <? // more fields ?>

</div>    


<div class="row">

   <? // button ?>

</div>