我有一个窗体有多个选择列表框。 我从这里使用它(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
你能给我们你写的代码吗? –