Hi,
For Forms, I found sample code on another post to hide/show the submit & reject buttons based on the selection of a drop down field. Does anyone have code that would do the same thing based on a radio button?
Thank you in advance,
Terri
Hi,
For Forms, I found sample code on another post to hide/show the submit & reject buttons based on the selection of a drop down field. Does anyone have code that would do the same thing based on a radio button?
Thank you in advance,
Terri
Hello Terri,
I was able to control the Approve and Reject buttons using the code below:
$(document).ready(function () { $("#q1").on("change", function() { if($('#Field1-0').is(':checked')) { $(".action-btn.Reject").hide(); $(".action-btn.Approve").show(); } if($('#Field1-1').is(':checked')) { $(".action-btn.Approve").hide(); $(".action-btn.Reject").show(); } }); });
Where q1 is the id of the radio button field. Field1-0 and Field1-1 are the ids of the radio button selections and can be found by right clicking the radio button and selecting inspect element, which will bring up a window showing the ids as shown below:
Hope this helps!
This code is based off of having only 2 radio buttons that select which button is shown and which button is hidden.
Thank you- This works perfectly
I've applied this to a checkbox variable and it works properly when you check/uncheck the box. However it doesn't automatically execute when the page first loads. I would like the Approve button hidden when the page first loads as the variable is always unchecked, but currently both buttons are showing. Any suggestions?
Thank You Winston for the answer and to Terri for asking the original question!
It worked for my Approve / Deny radio buttons.
Christine