/* global jQuery */
(function ($) {
  "use strict";

  $(function () {
    const $form = $("#adminEntityForm");

    $form.on("submit", function (e) {
      e.preventDefault();

      if (!this.checkValidity()) {
        e.stopPropagation();
        $form.addClass("was-validated");
        return;
      }

      $form.addClass("was-validated");
      alert("Form is valid and ready for API submission.");
    });
  });
})(jQuery);

