Skip to main content
bmclark08
Participant
December 6, 2017
Question

How do I restrict the number of times an answer is selected from a drop down?

  • December 6, 2017
  • 2 replies
  • 1404 views

I know next to nothing about coding. Here's my scenario: I have a set of 29 options with drop down selections of Level 1, 2, 3, or 4. I want to input selection rules so that out of the 29, someone can only select the "Level 1" option a maximum of 7 times. Is this possible?

This is an example of 1 of 29 options on my form:

Here is the legend:

Level 1: 1-7 drug classes means that you can only select a MAXIMUM of 7 drug classes as Level 1

This topic has been closed for replies.

2 replies

Joel Geraci
Community Expert
Community Expert
December 6, 2017

Can you explain what you are trying to achieve in the end? It might be easier to just let the user select the number of drug classes they require and then assign the correct level 1-4 as they go.

bmclark08
bmclark08Author
Participant
December 11, 2017

Well, it's not that there are right and wrong answers. For example, they can select up to 7 drugs that they would like to test for at level 1. No more than 7. They can then select 8-14 drugs for level 2, no more no less. 15-21 drugs at level 3. and 22 and up for level 4.

bmclark08
bmclark08Author
Participant
December 11, 2017

There are a couple of options for a solution. You could have a validation script that tests the current number of selections and then accepts or rejects the current selection based on the outcome. Another solution is to remove list options if they are already selected too many times.

However, this is a JavaScript forum. It is intended to help you learn how to create your own solution. It is not a 'get your project done for free' forum. If you just want this done you need to hire someone.


Absolutely. Completely understand. Was really looking to learn about the possible capabilities. We have a developer that works with our company full time. If I want him to do something quickly, I have to explain as much as I possibly can to him. As I don't know much of anything about coding, it's sometimes difficult to zero him in on what I need done.

That being said, what I think would work best for us is the selection option being removed after too many have been selected. Can you speak more to that solution so I can lead him in the right direction? Maybe more in the direction of where he would need to insert the script to run? Sorry, just want to be able to give him as much information as I can. Not sure how much experience he has with adding custom script to Adobe.

Thom Parker
Community Expert
Community Expert
December 6, 2017

Yes you can, but this is complicated.  Are you going to learn JavaScript and write this yourself?

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
bmclark08
bmclark08Author
Participant
December 11, 2017

I was hoping not to. I don't really have the time to do it. In the future, yes. Right now, no.