Skip to main content
Known Participant
August 8, 2017
Question

drop down calculating percentage

  • August 8, 2017
  • 2 replies
  • 923 views

I was wondering, is it possible to use one drop down box to apply a percentage to a specific total field? But, then clicking the same drop down box would then apply a different percentage to a different total field on the second click. At the moment I have one drop down that applies the percentage to two different total fields, at the same time but now I'd like to be able to apply two different percentages from the same drop down. I'm trying to not clutter up the form by using another drop down that would apply the selected percentage. So, I thought it would be possible with a bit of javascript and know how, to use one drop down to select the percentage. Or, I'm always open to suggestions that would work. Thanks, guys.

This topic has been closed for replies.

2 replies

try67
Community Expert
Community Expert
August 8, 2017

If you use Bernd's advice then it can be done using a script, yes.

pdfUser1Author
Known Participant
August 9, 2017

The good news is, I'm thrilled to hear that this can be done. The bad news is, I have no clue how to write the script or where to put it if I had one. Or, where to look to find an example of it. Any suggestions where I could find a working example?

I was looking and looking at what Bernd suggested and correct me if I'm wrong, is it going to add 10% to a total field on the first click then 10% to a second total field on the second click? The second click I should select a different percentage. I'm very curious to see how this is done. Is it a complicated script?

Bernd Alheit
Community Expert
Community Expert
August 9, 2017

I mean this:

selection of first item: 10% for first total and 10% for second total

selection of second item: 10% for first total and 15% for second total

and so on

Bernd Alheit
Community Expert
Community Expert
August 8, 2017

What about a dropdown like:

10% / 10%

10% / 15%

15% / 15%

and so on

pdfUser1Author
Known Participant
August 9, 2017

thanks for replying, but I really don't understand. Would you provide an example script?

try67
Community Expert
Community Expert
August 9, 2017

You will need to take the value of the drop-down, split it using the forward-slash as the delimiter, and then use different values in your calculations. To be hones, I think this is a really bad way of doing it. It will be much easier to simply create two drop-downs...