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

Question

Question

Feature Request: ability to hide/show submit button using field rules

asked on April 26, 2018

Self-explanatory. We implement this logic using JavaScript in pretty much every single form we develop. It would be nice if we could specify to hide action buttons on a form based on values in fields. For example, on a yes/no radio button, if the user selects No, we want to hide the submit button. Another example is if Field1 value does not equal Field2 value, we want to hide the submit button.

5 0

Replies

replied on April 26, 2018

That would be great!

In the meantime what we have done is hide the default action buttons with CSS like this:

.Submit, .Reject, .Approve {
 
  visibility: hidden;
  
}

And then we add a Custom HTML field and add code like this:

<span class="custButtonSet">
<input type="submit" class="action-btn checkRequired SubmitSubmit" name="action" aria-labelledby="action" value="Submit" style="display: inline-block;">

<input type="submit" class="action-btn checkRequired SubmitAdd" name="action" aria-labelledby="action" value="Add Another Milestone" style="display: inline-block;">
</span>

Then you can use field rules to hide/show the Custom HTML, no need for JavaScript. Those custom buttons will submit just like the default buttons as long as they have the "action-btn" class

hideShow.PNG
3 0
replied on October 22, 2018

This is incredibly helpful, thank you!
How would you go about changing the color of the "new" submit button?

Thanks!

1 0
replied on October 23, 2018

There are many ways to do it. You can do it inline by adding the color to the `style` attribute, or you can target the button's CSS class. Example:

.action-btn.SubmitAdd {
    background-color: green;
    color: white;
}

This will make the background green and the button text white.

Or you can leverage the styling that is made available via Bootstrap by adding the `btn-success` class to the button.

2 0
replied on April 26, 2018

Thanks for the feature request. We do have this on our backlog and I'll link this post to it as well. 

2 0
replied on April 26, 2018

I would very much agree with this.  Always have to do it through javascript and always takes a bunch of time trying to troubleshoot the code and when to run it (lookupcomplete etc.).  If we could just do it through the Laserfiche field rules it would be extremely helpful.

0 0
replied on May 16, 2018

This is a great suggestion! 

replied on December 21, 2022

Can I do this for the Approve and Reject buttons? If so, what do I need to change?

I'd like to use field rules to hide all buttons until certain conditions (multiple) are met. I have made a custom button for submit and it works fine, but I would like to do the same for Approve and Reject. Since I am not an experienced coder, this is probably my best bet.

Based on this post, I did try this with those buttons, but I keep having issues.

0 0
replied on January 6, 2023

Show/hide action button using field rules is supported with new form designer in Forms 11 Update 3.

You can see other changes of Forms 11 Update 3 from  https://support.laserfiche.com/kb/1014413/list-of-changes-for-laserfiche-forms-11-update-3 and get Forms 11 Update 3 from Laserfiche 11 package  https://support.laserfiche.com/kb/1014263/software-versions-and-fixes-included-in-the-laserfiche-11-download-package

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

Sign in to reply to this post.