我有一個窗體有多個選擇列表框。 我從這裏使用它(https://silviomoreto.github.io/bootstrap-select/examples/#custom-button-text) 我想驗證它。每件事情都很好,當我點擊提交表單時,它會返回一條消息,表明此字段是必需的,但邊框顏色不會更改爲紅色。jQuery驗證多選擇框
0
A
回答
0
我創建了一個js小提琴,我看不到問題。您可以檢查此鏈接https://jsfiddle.net/36zopv3v/2/
<form data-toggle="validator" role="form">
<div class="form-group">
<label class="control-label">Select</label>
<select required multiple class="form-control selectpicker">
<option value="1">item1</option>
<option value="2">item2</option>
</select>
</div>
<div class="form-group">
<label for="inputName" class="control-label">Name</label>
<input type="text" class="form-control" id="inputName" placeholder="Cina Saffary" required>
</div>
<div class="form-group has-feedback">
<label for="inputTwitter" class="control-label">Twitter</label>
<div class="input-group">
<span class="input-group-addon">@</span>
<input type="text" pattern="^[_A-z0-9]{1,}$" maxlength="15" class="form-control" id="inputTwitter" placeholder="1000hz" required>
</div>
<span class="glyphicon form-control-feedback" aria-hidden="true"></span>
<div class="help-block with-errors">Hey look, this one has feedback icons!</div>
</div>
<div class="form-group">
<label for="inputEmail" class="control-label">Email</label>
<input type="email" class="form-control" id="inputEmail" placeholder="Email" data-error="Bruh, that email address is invalid" required>
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
<label for="inputPassword" class="control-label">Password</label>
<div class="form-inline row">
<div class="form-group col-sm-6">
<input type="password" data-minlength="6" class="form-control" id="inputPassword" placeholder="Password" required>
<div class="help-block">Minimum of 6 characters</div>
</div>
<div class="form-group col-sm-6">
<input type="password" class="form-control" id="inputPasswordConfirm" data-match="#inputPassword" data-match-error="Whoops, these don't match" placeholder="Confirm" required>
<div class="help-block with-errors"></div>
</div>
</div>
</div>
<div class="form-group">
<div class="radio">
<label>
<input type="radio" name="underwear" required> Boxers
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="underwear" required> Briefs
</label>
</div>
</div>
<div class="form-group">
<div class="checkbox">
<label>
<input type="checkbox" id="terms" data-error="Before you wreck yourself" required> Check yourself
</label>
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</form>
+0
tnk你這麼多@Eren我發現我的問題與您的示例 – leman17
+0
偉大的,如果這有助於您請率和檢查作爲一個正確的答案 –
0
<select required multiple>
<option value="1">item1</option>
<option value="2">item2</option>
</select>
<style>
.has-error .btn-default{border:2px solid red !important}
</style>
相關問題
- 1. jquery驗證分組多個選擇框
- 2. jquery驗證和多選擇框
- 3. 選擇框不驗證,jqtransform jquery驗證
- 4. jQuery的驗證選擇框
- 5. jQuery選擇框驗證
- 6. 使用jQuery驗證插件驗證多個選擇框
- 7. 驗證與jQuery驗證和選擇插件的選擇框
- 8. 驗證選擇框
- 9. 驗證選擇框
- 10. jquery /驗證插件/對象文字:選擇多個複選框
- 11. jQuery UI對話框驗證選擇
- 12. Jquery驗證和選擇框的列表
- 13. jQuery的驗證選擇框與HTML值
- 14. Jquery驗證插件 - 選擇框問題
- 15. 選擇框問題與JQuery驗證
- 16. 驗證複選框選擇
- 17. 表單驗證多維選擇框
- 18. 忽略jQuery驗證多選擇器
- 19. JQuery驗證多個單選框組
- 20. jQuery驗證多個複選框
- 21. jQuery驗證插件多個複選框
- 22. JQuery的驗證多個複選框組
- 23. JQuery多重複選框組驗證
- 24. jQuery驗證插件沒有驗證我的奇特選擇框
- 25. 如何驗證jQuery驗證中的選擇框?
- 26. jQuery驗證插件未驗證選擇框
- 27. jquery驗證插件,選擇值驗證
- 28. 如何驗證選擇與jQuery驗證?
- 29. jquery驗證和引導 - 選擇字段選擇多個選項
- 30. jQuery驗證插件複選框驗證
。先後錯誤.btn默認{ 邊界:1px的固體紅; } 我已經試過這個,但它不工作 – leman17
你能給我們你寫的代碼嗎? –