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

Radio Button and required Text

Guest
Jan 03, 2018 Jan 03, 2018

Copy link to clipboard

Copied

Hello,

Can someone help me please. I never used Javascript and I am creating a form in Adobe Acrobat DC. I have two radio buttons one called DO and the second one called Other. I also have a text box called Other Explanation.

I need to when somebody mark radio button Other to be required to fill out the text box Other Explanation.

Thank you. 

TOPICS
PDF forms

Views

3.0K

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
1 ACCEPTED SOLUTION
Community Expert ,
Jan 04, 2018 Jan 04, 2018

Copy link to clipboard

Copied

I suspect you mean the export values for the radio button group are "DO" and "Other"?

If this is true then you can add the following code to the MouseUp events for each radio button in the group.

"DO" Button:

this.getField("Other Explanation").required = false;

"Other" button:

this.getField("Other Explanation").required = true;

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

View solution in original post

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 ,
Jan 04, 2018 Jan 04, 2018

Copy link to clipboard

Copied

I suspect you mean the export values for the radio button group are "DO" and "Other"?

If this is true then you can add the following code to the MouseUp events for each radio button in the group.

"DO" Button:

this.getField("Other Explanation").required = false;

"Other" button:

this.getField("Other Explanation").required = true;

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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
Participant ,
Mar 16, 2018 Mar 16, 2018

Copy link to clipboard

Copied

Hi, if I wanted that radio button to make 3 different fields req'd? I used, commas to seperate, does not work. Tried quotes around each, no good..Ideas?

this.getField("If yes please provide the name and address of the patent agent", "Name", "Email address", "Date YYYYMMDD").required = true;

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 16, 2018 Mar 16, 2018

Copy link to clipboard

Copied

LATEST

the "getField" function acquires a single form field object. The input to this function is the field name.

You should consider learning a bit about programming JavaScript, and the Acrobat JavaScript model.

Here are some video tutorials that will help you get started:

Free Video Content & Full Listing of Available Videos

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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
Guest
Jan 04, 2018 Jan 04, 2018

Copy link to clipboard

Copied

Thank you so much!!

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