I have the following JS Fiddle : https://jsfiddle.net/walker123/6toLch92/34/
I am trying to prevent the form from submitting if user doesn’t select anything or even if one of the things is not selected. So I did the following inside my getConcepts()
function based on sTx
answer from this post
function getConcepts(){
alert("Function getConcepts is clicked");
var bootstrapValidator = $("#validateForm").data('bootstrapValidator');
bootstrapValidator.validate();
if(bootstrapValidator.isValid())
{
$("#validateForm").submit();
console.log("Submitting form after validation");
}
else return;
}
Wanted to see if above is a correct way of validating?