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

Question

Question

Hiding the Approve button until Signed

asked on January 16, 2018

Okay, I got some help at the conference but I'm not sure why I'm struggling still with this. I'm more than positive its the code but it seems correct. I got it to hide the submit button. But when I click the signature button. it just make a blank or it put a blank and a signature.

$(document).ready(function () {
  
  $('.Approve').hide(); 
  
  $('.signSignatureBtn').click(function () {
    $('.Approve').show(); 
  });
  
  $(document).on('click','.form-sig-remove',function(){
    $('.Approve').hide(); 
  });
  
});

 

1 0

Answer

SELECTED ANSWER
replied on January 16, 2018

Hi Chynna,

Can you check the signature field setting and see if it has option like this:

If so, change the option to "Prompt to draw". It is because in your script, it would show the approve button when the "signSignatureBtn" is clicked; if you allow user to use default signature and user already has signature defined, the sign signature dialog won't show up.

1 0
replied on January 18, 2018

@████████ Is there any way I can change it to allow default signature?

0 0
replied on January 18, 2018

Then you need to change your script to support default signature. One way is to use setTimeout function and keep checking if signature has been signed like this:

$(document).ready(function () {
  
  $('.Approve').hide(); 
  
  $('.Sign_Sig').click(function(){
    setTimeout(CheckSignatureDisplayed, 500);
  });
  
  function CheckSignatureDisplayed() {
    console.log($('.form-sig-preview').length);
    if ($('.form-sig-preview').length > 0) {
      $('.Approve').show();
    }
    else {
      setTimeout(CheckSignatureDisplayed, 500);
    }
  }
  
  $(document).on('click','.form-sig-remove',function(){
    $('.Approve').hide(); 
  });
  
});

 

 

1 0
replied on January 27, 2021

I know it has been years from the last post here, but I'm hoping someone can explain just how the code above does not get stuck into an infinite recursive loop? With CheckSignatureDisplayed only apparent out is if the user signs the document. How does it stop if the user simply cancels instead of signing?

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.