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

Question

Question

Show/Hide Submit buttons with Multiple Conditions for different steps in the form

asked on February 16, 2023

I have a form that I cannot duplicate out to make different versions of the same form for different steps.  I am using show hide/rules for each task based on an updated status from Workflow.  I need to use the Submit button each time the form moves to the next task.  I have a JS for hiding the submit button on the initial form until a checkbox is checked at the end, however when it goes to the next step, the box has to be unchecked and rechecked in order to the submit button to appear again since its saves whatever was filled out.  How can I add additional condition values to get the submit button to appear when it moves on to the next step?  I don't want to use a different button either or another piece of my JS wont work properly.

 

This is what I'm currently using.  

  $('.Submit').hide();
	 $('.showsubmitcheckbox').click(function () {
      if ($('input[value="Accept"]').is(':checked')) {
      	  $('.Submit').show();
    }
    else {
      	$('.Submit').hide();
    }
  });

 

0 0

Replies

replied on February 16, 2023

Hi Angela,

 

You just need to set the checkbox's checked status to false on form load, like this:

$(document).ready(function(){
  $('.Submit').hide();
  //Set the checked status to false when initialize the form
  $('.showsubmitcheckbox input[type="checkbox"]').prop("checked", false);
  $('.showsubmitcheckbox').click(function () {
    if ($('input[value="Accept"]').is(':checked')) {
      $('.Submit').show();
    }
    else {
      $('.Submit').hide();
    }
  });
});

 

1 0
replied on February 17, 2023

Because of Pagination, the task approver would have to go back and recheck it which we dont want.  Is there a way to add multiple values to trigger the button?

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

Sign in to reply to this post.