You are viewing limited content. For full access, please sign in.

Question

Question

Alert Message upon clicking submit if not all required fields filled

asked on February 3, 2023

Is there a way to have an Alert Message pop up when someone clicks submit but not all the required fields have been dealt with?

0 0

Answer

SELECTED ANSWER
replied on February 3, 2023

Here's one way to do it using the Classic Designer.  This will do a pop-up alert on any validation errors, not just missing required fields.

$(document).ready(function () {

  //Alert User if required fields are missing.
  $(".action-btn.Submit").on('click', function() {
    var noErrors = true;
    $('#form1').parsley().validate();
    $('.parsley-error').each(function() {
      noErrors = false;
    });
    if (!noErrors) {
      alert('There are errors that must be resolved!');
    } 
  }); 

});

 

If you want it to work on any of the Submit/Approve/Reject/Save buttons instead of just Submit, then on line 4 change ".action-btn.Submit" to ".action-btn" instead.

0 0
replied on February 3, 2023

That works great, Matthew!  Thanks!

1 0
replied on February 3, 2023

Great!  I'm happy it works for you.

0 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.