title: setCustomValidity to Bootstrap 4 validaiton?
body: <p>I have this html to display a error message</p>
  <pre class="lang-html prettyprint-override"><code>&lt;form id=&quot;order-form&quot; class=&quot;needs-validation&quot; method=&quot;post&quot; enctype=&quot;multipart/form-data&quot; novalidate&gt;
  &lt;div id=&quot;quantity-zero&quot; class=&quot;invalid-feedback&quot;&gt;&lt;/div&gt;
  </code></pre>
  <p>I get Bootstrap validation on all fields but I also whant to add this to my validaiton.</p>
  <pre><code>$(&quot;#previewBtn&quot;).click(function(event) {
      var form = $(&quot;#order-form&quot;);
      var quantitySelected = null;
  
      $(&quot;.quantity-select&quot;).each(function () {
          if($(this).val() &gt; 0) {
              quantitySelected = true;
              return false;
          } else {
              quantitySelected = false;
              //$(&quot;#quantity-zero&quot;).show();
          }
      })
      
  </code></pre>
  <p>If quantitySelected is false I want to add this to by bootstrap error, below gives the error.</p>
  <blockquote>
  <p>Error: TypeError: $(...).form is undefined</p>
  </blockquote>
  <pre><code>if(quantitySelected === false) {
      $(&quot;#quantity-zero&quot;).form.setCustomValidity('This is an error.');
      }
  </code></pre>
  <p>I validate the form with this</p>
  <pre><code>    if (form[0].checkValidity() === false) {
          event.preventDefault();
          event.stopPropagation();
          } else {
          $(&quot;#exampleModal&quot;).show();
      }
      form.addClass('was-validated');
      
  });
  </code></pre>
  <p>How can I display an error together with my other bootrap validation if <code>quantitySelected</code> is false?</p>