• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Ensuring radio buttons are selected before field is unhidden

Community Beginner ,
Mar 02, 2021 Mar 02, 2021

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!

Views

416

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 02, 2021 Mar 02, 2021

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 02, 2021 Mar 02, 2021

Copy link to clipboard

Copied

Adobe Acrobat Pro DC

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 02, 2021 Mar 02, 2021

Copy link to clipboard

Copied

You must change the property "display" of the field.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 02, 2021 Mar 02, 2021

Copy link to clipboard

Copied

HI,

 

Can you elaborate further? I dont't understand what I need to change exactly.

 

Thank you!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 02, 2021 Mar 02, 2021

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;

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 02, 2021 Mar 02, 2021

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 02, 2021 Mar 02, 2021

Copy link to clipboard

Copied

The value of a radio button will never empty. The value of a unchecked radio button is "Off".

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 02, 2021 Mar 02, 2021

Copy link to clipboard

Copied

So should I use checkboxes instead of radio buttons?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 02, 2021 Mar 02, 2021

Copy link to clipboard

Copied

No. You must change the script.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 02, 2021 Mar 02, 2021

Copy link to clipboard

Copied

LATEST

Thank you for responding. I will continue to do more research to figure out how to properly change the script..

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines