簡體   English   中英

引導程序表單組

[英]Bootstrap form-group

我從引導框架中獲得了一個表單組內的兩個輸入。 我的問題是,如果名字給錯誤,第二個名字也會給與名字相同的錯誤,那不是我想要的,我該如何避免這個問題?

<form id="containerForm" class="form-horizontal">
    <div class="form-group">
        <label class="col-xs-3 control-label">First name</label>
        <div class="col-xs-4">
            <input required type="text" class="form-control" name="firstName" placeholder="First name" />
        </div>
        <label class="col-xs-3 control-label">Last name</label>

        <div class="col-xs-4">
            <input required type="text" class="form-control" name="lastName" placeholder="Last name" />
        </div>
    </div>
</form>

這不是一個完整的答案,但是Stackoverflow.com上有更多關於此項目的文章。

無論如何,我還是建議您使用服務器端驗證

But just to get you going see this example:

http://jsfiddle.net/z2zbgge3/1/

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM