Code to move Location of Validation Rule Message

So I have a form when the validation rule pops up because it was triggered it displays at the top of the form. Because of the form size the user wont see it unless they scroll back to the top of the page. Does anyone have code to move it to the bottom of the page? Thank you.

Here’s some code that should do the trick. It could be improved by removing the setTimeout and instead listening for the error, but I didn’t have the time to really dive into this.

//change your view
$(document).on("knack-view-render.view_xx", function (event, view, data) {
  Knack.$(`#${view.key} form`).on("submit", function () {
    setTimeout(() => {
      if (Knack.$(".kn-message.is-error")) {
        Knack.$(".kn-submit").after(Knack.$(".kn-message.is-error"));
      }
    }, 1000);
  });
});
1 Like

Thanks for posting @Kelson - looking forward to trying this out.