Trying to prevent form from submitting with bootstrapvalidator

I have the following JS Fiddle :

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');
           console.log("Submitting form after validation");
           else return;

Wanted to see if above is a correct way of validating?

1 Like