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

Question

Question

Forcing validation of signature field before move to next page

asked on October 22, 2020

Hi,

I have a form that has three pages. The fields across all the page are required and user must complete them before moving to next page. I found the following code on this resource site and used it. It worked well for all the fields except the signature field.

 

$(document).ready(function(){
  $("#form1").change(validate);
  validate();
  $('.cf-next-btn').click(validate);
  $('.cf-prev-btn').click(validate);
  function validate() {
    if ($("#form1").parsley({excluded:":hidden"}).isValid()) {
      $('.cf-next-btn').show();
    }
    else {
      $('.cf-next-btn').hide();
    }
  }
})

My question is how to validate the signature before allowing user to move to next page. I am using Forms version 10.3.0.975. Thank you.

 

Sincerely,

 

Wissam

0 0

Replies

replied on October 22, 2020 Show version history

Is there a reason why your manually triggering the validation as opposed to making them required fields and allowing it to automatically check on submit?

0 0
replied on October 22, 2020

I did make all the fields required, but since I am working with three pages, I do not want the users to reach to the submission button before realizing that they have missed a field in the first or second page. This is why I used the above code, so that the Next button only appears after they have entered all required fields in a page.

Despite this, the signature field gets missed. The signature field is on the second page and it is marked as required. The form will not get submitted if the signature is not added on the second page, but I do not want users to realize this by the time they reach the submission button. 

For some reason, the validation code does not see the signature field. Here is where I need the help. Thank you.

0 0
replied on October 22, 2020 Show version history

I see well thanks for providing the additional context. So I added the following line to trigger a validation check on the sign button click in the signature modal window and with the rest of your code that seemed to work for me. Let me know if that helped.

Just added the line below to your function.

$('#form-signature-dlg button.signSignatureBtn').click(validate);

 

0 0
replied on October 23, 2020 Show version history

Where should I add this line in the code snippet? Thanks.

0 0
replied on October 23, 2020

Try This:

$(document).ready(function(){
  $("#form1").change(validate);
  validate();
  $('.cf-next-btn').click(validate);
  $('.cf-prev-btn').click(validate);
  $('#form-signature-dlg button.signSignatureBtn').click(validate);
  function validate() {
    if ($("#form1").parsley({excluded:":hidden"}).isValid()) {
      $('.cf-next-btn').show();
    }
    else {
      $('.cf-next-btn').hide();
    }
  }
})

 

0 0
replied on October 23, 2020

Hi - It did not work. I am getting the same behavior. I tried to put the line after line number 2. Also did not work. 

0 0
replied on October 23, 2020

The problem might be with the selector, make sure the selector is actually returning a a single button and its the green sign button from the modal window. Maybe replace the validate function call with a console.log statement to make sure you're at least getting that far. This works as is for my simple setup with a few fields and one signature field.

0 0
replied on December 20, 2021

The modal button trigger is too fast for signature validation to be true. A delay is needed.

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

Sign in to reply to this post.