jqBootstrapValidation
jqBootstrapValidation copied to clipboard
empty select null value error
I have a form where a selects options are populated via ajax, and can be empty, under certain conditions.
If a select field is empty (i.e 0 options) and you try to submit a form, validation fails because .val() will return null.
The problem seems to be on line 864 of jqBootstrapValidation. Adding the following below that line seems to fix it.
if(value == null) value = '';
Hi @btantlinger ;
Changing it there might have repercussions elsewhere. What validator(s) were you using that caused the error when they got a 'null' back?
Thanks
The only validation on the select was required. If it has 0 options, it appears to return null.
I'm having the same issue. Any advice?