2016-09-16 56 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