2014-02-08 46 views
1

Heyo!如何在控件組中正確嵌套輸入組

我想在帶有標籤的窗體組的文本框之前附加一個「09」input-group-addon。

我試圖
1.推杆形式的基團和輸入組中的相同的元件 - 出來怪異
2.嵌套輸入的基團的形式組中封裝的標籤,跨度和輸入 - 出來怪異
3.嵌套輸入組封裝跨度和輸入 - 出來奇怪

我試過Google搜索它,發現我應該使用#2(從列表中我試圖做),但他沒有'不要使用a。看來,輸入組插件使用整個高度(包括。

<div id="TelNumber" runat="server" EnableViewState="False" class="form-group col-md-3"> 
       <div class="input-group"> 
       <label class="control-label">Telephone Number</label> 
       <span class="input-group-addon">09</span> 
       <asp:TextBox ID="txtTel" runat="server" class="form-control input-sm" /> 
        </div> 
       <p class="help-block"> <asp:CheckBox ID="chkShowTel" runat="server" Text="Show telephone number on profile" /></p> 
      </div> 

關於如何解決此問題的任何想法?在此先感謝!

回答

0

試試這個..

<div id="TelNumber" runat="server" enableviewstate="False" class="form-group col-md-3"> 
    <label class="control-label">Telephone Number</label> 
    <div class="input-group"> 
    <span class="input-group-addon">09</span> 
    <input type="text" class="form-control"> 
    </div> 
    <p class="help-block">Show telephone number on profile</p> 
</div> 

http://bootply.com/111900

+0

我試過這個(#3)但我不知道爲什麼你的工作和我的沒有。 –