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

Question

Question

Pop-Up Confirmation on Approve & Reject Buttons

asked on December 29, 2014

Is there a javascript method where I can have pop-up confirmation buttons attached to the Approve or Reject buttons on a Form?  The customer has a form that if the user approves will trigger a workflow that writes to a database.  If they reject then it ends the process.  In both cases they want a pop-up that asks the person if they really want to approve the form (if Approve is clicked) or if they really want to reject the form (if Reject is clicked).  Hopefully a future version will have a confirmation pop-up as an option but for now I am looking for a way to manually provide this functionality.  

0 0

Replies

replied on December 30, 2014

Hi Beau,

I've been wondering about this myself... I'll post a couple of ideas, starting with the one I'm using.

The route I went was to create a tick-box field called "Proceed?" When the user ticks the box, a function is called to test fields and then un-ticks the box if there's a problem. Because the tick box is mandatory, "Proceed" can't be clicked.

  function fnProceesCheck() {
    if ($('#q5 input').val()!=$('#q6 input').val()) {
     //display an alert 
     alert('Two values don't match.');
     //un-tick the box
    $('.proceedCheckBox input').attr('checked',false);  
    } else {
      //do somthing else
    }
  }

$('.proceedCheckBox').change(fnProceesCheck);

 

The method that you're after is not something I've tested. However, I imagine you'd create your own "Proceed" button using the custom HTML field on the form.

Then you'd hide the Laserfiche one using the CSS...

Finally you'd code for your button and have it "click" the Laserfiche one:

function fnMyClick() {
  // do some checking and all sorts of stuff
 
  // if the the form looks good, click the Laserfiche proceed button for the user
  $('.action-btn').click();
}

$('.myProceedButton').click(fnMyClick);

That should allow you to create your own custom "Approve" and "Reject" buttons as well. Let me know how you go :)

-Ben

 

1 0
replied on November 13, 2015

I just ran into this same request again and am still using the option of hiding the field until they check a box.  In this case the customer wanted a "Cancel" button that cancelled an entire process but didn't want anyone to accidently click on it. So I added a "Cancel" check box that triggers showing/hiding the "Cancel" button.

1 0
replied on December 30, 2014

Thanks for the two great ideas.  I'd thought of essentially "hiding" the approve and reject buttons and then using a check box (with options to approve or reject) to then show the matching button when a box was checked.  Thus they would have to check the correct box and then click the button.  I will give your ideas a shot and post back how they go.  As the "confirmation" option has become fairly common across most websites, I hope future versions of Forms will have this functionality built-in.  

0 0
replied on November 13, 2015 Show version history

I am looking for the same functionality, but just for the Reject button. Have you guys have had any success with a different method, one that doesn't involve hiding any of the Laserfiche buttons? 

0 0
replied on November 13, 2015

I hope the next upgrade has this feature built in, pretty common request. 

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

Sign in to reply to this post.