我用 yii booster 创建了表单,但是在 textFieldRow 标签之前添加了一个空行。有我的代码:
<div class="form">
<?php
$form=$this->beginWidget('bootstrap.widgets.TbActiveForm', array(
'id'=>'location-form',
'type'=>'horizontal',
));?>
<fieldset>
<pre><span class="note text-info"><?php echo Yii::t('Site', 'requiredFieldsHint'); ?></span></pre>
<?php echo $form->textFieldRow($promocode,'code',
array('maxlength'=>200,'id'=>'code'));?>
<div id='username_availability_result'></div>
</fieldset>
<fieldset>
<?php echo $form->textFieldRow($promocode,'code',array('maxlength'=>200,'id'=>'code'));?>
<?php echo $form->textFieldRow($promocode,'code',array('maxlength'=>200,'id'=>'code'));?>
<?php echo $form->textFieldRow($company,'isActive',array('maxlength'=>180,'id'=>'code'));?>
<?php echo $form->textFieldRow($company,'name',array('maxlength'=>180,'id'=>'code'));?>
<?php echo $form->textFieldRow($company,'name',array('maxlength'=>180,'id'=>'code'));?>
<?php echo $form->textFieldRow($promocode,'code',array('maxlength'=>200,'id'=>'code'));?>
<?php echo $form->textFieldRow($promocode,'code',array('maxlength'=>200,'id'=>'code'));?>
</fieldset>
<div class="form-actions">
<?php $this->widget('bootstrap.widgets.TbButton', array(
'buttonType'=>'submit',
'type'=>'primary',
'label'=>Yii::t('actions', 'Submit'),
'htmlOptions' => array('style'=>'align:center;padding: 4px 58px;'),
));
?>
</div>
<?php $this->endWidget(); ?>
</div>
结果:
关于萤火虫: