-
Notifications
You must be signed in to change notification settings - Fork 472
Cannot validate bootstrap-select #355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The actual select element becomes hidden by bootstrap-select. Have you tried to turn on <form>
...
<select class="selectpicker show-menu-arrow" data-validation="required">
<option value="">-- Select something --</option>
<option>A</option>
<option>B</option>
<option>C</option>
</select>
...
</form>
<script>
$.validate({
validateHiddenInputs: true
});
</script> |
I need to see your entire code. |
This is all the code from this section:
|
I found something in the code that might be of help. It's undocumented due to the fact that this will change when #153 is implemented. However, you need to use <form>
...
<input type="radio" name="limited" value="yes"> Yes
<input type="radio" name="limited" value="no"> No
...
<select class="selectpicker show-menu-arrow"
data-validation="required"
data-validation-if-checked="limited"
data-validation-if-checked-value="yes">
<option value="">-- Select something --</option>
<option>A</option>
<option>B</option>
<option>C</option>
</select>
...
</form> |
Thank you! So no hope in this time for validation trough radio buttons only check boxes for now? |
Have you tried the code example above? It should work with radio buttons... |
Beautiful! It works! Thank you! |
It work flawlessly, but now i have a problem. The condition works only if the first radio button is clicked no matter of the value. But i need this to work with different values. Any ideas? <form>
...
<input type="radio" name="limited" value="yes"> Yes
<input type="radio" name="limited" value="no"> No
...
<select class="selectpicker show-menu-arrow"
data-validation="required"
data-validation-if-checked="limited"
data-validation-if-checked-value="yes">
<option value="">-- Select something --</option>
<option>A</option>
<option>B</option>
<option>C</option>
</select>
...
</form> |
That will require some custom code, until #153 is implemented |
@victorjonsson it didn't work for me, |
@asmaazoghbi Could you please provide me with your form markup? |
I'm not able to reproduce this bug with the latest published version of the plugin (that is about 10 months old). You must set http://jsbin.com/kupevoreha/1/edit?html,js,output To improve the user experience you might use <select
data-validation="length"
data-validation-length="min2"
data-validation-error-msg="You must pick at least two options"
data-validation-event="change"
class="selectpicker"
multiple
style="display: none;">
<option>option1</option>
<option>option2</option>
<option>option3</option>
<option>option4</option>
</select>
...
<script>
$.validate({
validateHiddenInputs: true,
validateOnEvent: true
})
</script> |
Use this css and js for selectpicker, for me it is worked after this used. |
Thank you for the great plugin! Now I'm trying to validate without success one drop down with bootstrap-select (https://silviomoreto.github.io/bootstrap-select/). Any ideas?
Thank you in advance!
The text was updated successfully, but these errors were encountered: