2016-09-16 28 views
0

每当我尝试创建包装到第二行的标签时,它会开始搞乱列放置。Bootstrap多行标签导致列大小问题

<div class="form-group"> 
     <label for="ReqPhone" class="col-sm-3 control-label">Phone Number:</label> 
     <input type="hidden" name="Phone" value="<?php echo $ophone ?>"> 
     <div class="col-sm-8"> 
      <input type="text" class="form-control" data-validation="required" name="ReqPhone" id="ReqPhone" placeholder="Phone Number" maxlength="20"> 
     </div> 
    </div> 
    <div class="form-group"> 
     <label for="ReqPhone" class="col-sm-3 control-label">Are you the Nominee’s Direct Supervisor?</label> 
     <input type="hidden" name="Phone" value="<?php echo $ophone ?>"> 
     <div class="col-sm-8"> 
      <select class="form-control"> 
       <option value="" disabled selected>Select an Option...</option> 
       <option value="one">Yes</option> 
       <option value="two">No</option> 
      </select> 
     </div> 
    </div> 
    <div class="form-group"> 
     <label for="ReqPhone" class="col-sm-3 control-label">Supervisor's Name:</label> 
     <input type="hidden" name="Phone" value="<?php echo $ophone ?>"> 
     <div class="col-sm-8"> 
      <select class="form-control"> 
       <option value="" disabled selected>Select an Option...</option> 
       <option value="one">Yes</option> 
       <option value="two">No</option> 
      </select> 
     </div> 
    </div> 

这就是我得到的结果。我只是试图让这些堆叠正确,同时拥有多行标签。

enter image description here

回答

1

首先,我注意到您的所有标签都是相同的输入( “ReqPhone”)。 其次,你用于表格的课程是什么?尝试使用form class='form-horizontal'

也许这将帮助:

<div class="form-group"> 
    <label for="ReqPhone" class="col-sm-3 control-label">Phone Number:</label> 
    <input type="hidden" name="Phone" value="<?php echo $ophone ?>"> 
    <div class="col-sm-8"> 
     <input type="text" class="form-control" data-validation="required" name="ReqPhone" id="ReqPhone" placeholder="Phone Number" maxlength="20"> 
    </div> 
</div> 
<div class="form-group"> 
    <label for="Nominee" class="col-sm-3 control-label">Are you the Nominee’s Direct Supervisor?</label> 
    <input type="hidden" name="Phone" value="<?php echo $ophone ?>"> 
    <div class="col-sm-8"> 
     <select class="form-control" id='Nominee'> 
      <option value="" disabled selected>Select an Option...</option> 
      <option value="one">Yes</option> 
      <option value="two">No</option> 
     </select> 
    </div> 
</div> 
<div class="form-group"> 
    <label for="NameSupervisor" class="col-sm-3 control-label">Supervisor's Name:</label> 
    <input type="hidden" name="Phone" value="<?php echo $ophone ?>"> 
    <div class="col-sm-8"> 
     <select class="form-control" id='NameSupervisor'> 
      <option value="" disabled selected>Select an Option...</option> 
      <option value="one">Yes</option> 
      <option value="two">No</option> 
     </select> 
    </div> 
</div> 
+0

谢谢!这是我的问题。 – collint25

0

确保它是在一个form-horizontal ..

<div class="form form-horizontal"> 
     <div class="form-group"> 
      <label for="ReqPhone" class="col-sm-3 control-label">Phone Number:</label> 
      <input type="hidden" name="Phone" value="<?php echo $ophone ?>"> 
      <div class="col-sm-8"> 
       <input type="text" class="form-control" data-validation="required" name="ReqPhone" id="ReqPhone" placeholder="Phone Number" maxlength="20"> 
      </div> 
     </div> 
     <div class="form-group"> 
      <label for="ReqPhone" class="col-sm-3 control-label">Are you the Nominee’s Direct Supervisor?</label> 
      <input type="hidden" name="Phone" value="<?php echo $ophone ?>"> 
      <div class="col-sm-8"> 
       <select class="form-control"> 
        <option value="" disabled="" selected="">Select an Option...</option> 
        <option value="one">Yes</option> 
        <option value="two">No</option> 
       </select> 
      </div> 
     </div> 
     <div class="form-group"> 
      <label for="ReqPhone" class="col-sm-3 control-label">Supervisor's Name:</label> 
      <input type="hidden" name="Phone" value="<?php echo $ophone ?>"> 
      <div class="col-sm-8"> 
       <select class="form-control"> 
        <option value="" disabled="" selected="">Select an Option...</option> 
        <option value="one">Yes</option> 
        <option value="two">No</option> 
       </select> 
      </div> 
     </div> 
    </div> 

http://www.codeply.com/go/lmk2IyMz14