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

How to prevent multiple selections of the same value in multiple fields

New Here ,
Apr 08, 2020 Apr 08, 2020

Copy link to clipboard

Copied

I have a user-input form with a series of questions that have 4 differently ranked answers for each question.  No duplicate ranking is allowed.  Example Question: "My favorite food is:"  Rank these possible answers from 1-4 in order of preference: Apple; Ice Cream: Fish; Wine

 

I'm using Acrobat Pro DC.  Can I create a script under either Calculate or Validate that would make this work?  If so, what would that be?  If not, any suggestion?

 

I have created 4 dropdown boxes for each of the 4 form fields.  They are named: Dropdown1a, Dropdown1b, Dropdown1c, Dropdown1d.  I would create/name the remaining fields as Dropdown2a, Dropdown2b, Dropdown2c, Dropdown2d, and so on.

 

I don't use JavaScript, but here's the simple script that I thought might work:

if(Dropdown1a) not= (Dropdown1b)
if(Dropdown1a) not= (Dropdown1c)
if(Dropdown1a) not= (Dropdown1d)

 

Any help is much appreciated.  Thank you.

TOPICS
Acrobat SDK and JavaScript

Views

50

Likes

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 ,
Apr 09, 2020 Apr 09, 2020

Copy link to clipboard

Copied

LATEST

This is not an easy problem to solve for several reasons. However, you'll find a paid for example that shows exactly how to do this here:

https://www.pdfscripting.com/public/Multiple-Lists-Unique-selection-Description.cfm

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

Likes

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