Copy link to clipboard
Copied
HI,
I have a "Click Here To Sign" button that will allow the signature field appear if all questions are answered. However, it isn't working with my Yes/No radio buttons. It works with the dropdown & text boxes that I have. If the dropdowns and text box are filled in, it unhides the signature box. It has no effect on the radio buttons. Here is my code:
var bEmpty = false;
var oFld = this.getField("Date")
bEmpty |= /^\s*$/.test(oFld.value);
var oFld = this.getField("Crewmember Name")
bEmpty |= /^\s*$/.test(oFld.value);
var oFld = this.getField("Vessel Name")
bEmpty |= /^\s*$/.test(oFld.value);
var oFld = this.getField("Radio1")
bEmpty |= /^\s*$/.test(oFld.value);
var oFld = this.getField("Radio2")
bEmpty |= /^\s*$/.test(oFld.value);
var oFld = this.getField("Radio3")
bEmpty |= /^\s*$/.test(oFld.value);
var oFld = this.getField("Radio4")
bEmpty |= /^\s*$/.test(oFld.value);
var oFld = this.getField("Radio5")
bEmpty |= /^\s*$/.test(oFld.value);
var oFld = this.getField("Radio6")
bEmpty |= /^\s*$/.test(oFld.value);
var oFld = this.getField("Radio7")
bEmpty |= /^\s*$/.test(oFld.value);
var oFld = this.getField("Radio8")
bEmpty |= /^\s*$/.test(oFld.value);
var oFld = this.getField("Radio9")
bEmpty |= /^\s*$/.test(oFld.value);
var oFld = this.getField("Radio10")
bEmpty |= /^\s*$/.test(oFld.value);
if(!bEmpty)
this.getField("Completed By").hidden = false;
Thank you for any help!
Copy link to clipboard
Copied
Please post the exact name of the Adobe program you use so a Moderator may move this message to that forum
.
When you ask a question you always need to provide some basic information
-Forum quick start https://community.adobe.com/t5/Community-Help/ASK-Forum-Success-Guide-Efficiently-using-the-forums/t...
-https://community.adobe.com/t5/Get-Started/Questions-you-need-to-answer-to-receive-better-help/td-p/...
-https://community.adobe.com/t5/get-started/how-to-post-and-get-your-issue-resolved-or-what-do-you-ne...
Copy link to clipboard
Copied
Adobe Acrobat Pro DC
Copy link to clipboard
Copied
You must change the property "display" of the field.
Copy link to clipboard
Copied
HI,
Can you elaborate further? I dont't understand what I need to change exactly.
Thank you!
Copy link to clipboard
Copied
Change these lines:
if(!bEmpty)
this.getField("Completed By").hidden = false;
To:
this.getField("Completed By").display = bEmpty ? display.hidden : display.visible;
Copy link to clipboard
Copied
It's still allowing the signature box to unhide without any of the radio buttons being checked. I want the signature field to unhide only if all of the questions are answered.
Copy link to clipboard
Copied
The value of a radio button will never empty. The value of a unchecked radio button is "Off".
Copy link to clipboard
Copied
So should I use checkboxes instead of radio buttons?
Copy link to clipboard
Copied
No. You must change the script.
Copy link to clipboard
Copied
Thank you for responding. I will continue to do more research to figure out how to properly change the script..