Bootstrap Form And Field Placement

HI all

I’m using the following code to generate a form




<?php $form=$this->beginWidget('bootstrap.widgets.TbActiveForm',array(

	'id'=>'registration-form',

	'enableAjaxValidation'=>false,


	    'htmlOptions'=>array('class'=>'well'),

)); ?>


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


<?php echo $form->textFieldRow($model,'f_name',array('class'=>'span5','maxlength'=>20)); ?>


<?php echo $form->textFieldRow($model,'l_name',array('class'=>'span5','maxlength'=>20)); ?>


<?php echo $form->textFieldRow($model,'phone_H',array('class'=>'span5','maxlength'=>15)); ?>


....

?>




now, this puts each field in a new row. what’s the proper way of having two fields on the same line?

let’s say I would want last name (l_name) and first name(f_name) fields to appear on the same line. do I need to use a different base form for this or can I just do it by changing the class attributes?

thanks

Pablo

Use divs:




<div class="row-fluid">

    <div class="span6">

        <?php echo $form->textFieldRow($model,'f_name',array('class'=>'span5','maxlength'=>20)); ?>

    </div>

    <div class="span6">

        <?php echo $form->textFieldRow($model,'l_name',array('class'=>'span5','maxlength'=>20)); ?>

    </div>

</div>



Fantastic! thanks

Glad to help… :)