These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

NOT be possible to exceed 100%

vpd85
Registered: Mar 19 2009
Posts: 39

When putting different percentages, it is still possible to exceed in the same LINE 100%.

Therefore it should NOT be possible to exceed 100%, this means that it should not be possible to enter more then 100%. Would it also be possible that the last result calculates itself, this means for example when you enter for BOX1 30%, for BOX2 30%, for BOX3 30% that then for BOX4 it appears automatically the resting amount until 100% (in this case 10%)?

Thanks a lot!

My Product Information:
LiveCycle Designer, Windows
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Hello,

for this task you need an algorythm that checks several parameters.
First the minimum and maximum values (0 and 100).
Then you need to know, what values the other fields have and how many of the range from 0 to 100 is still available now.
Finally you have to control if your input is not less than the minimum value or more than the maximum value and the available value.

Sounds complicated, isn't it?!
It isn't. You can realize this with a few lines of FormCalc in the exit events of your nummeric fiels.

Formular1.#subform[0].Box4::exit - (FormCalc, client)// Define the available range for the percentagesvar Maximum = 100var Minimum = 0 // Get the values of the other numeric fieldsvar BoxValueA = Box1var BoxValueB = Box2var BoxValueC = Box3 // Calculate what range of percentage is still available for this fieldvar BoxesValues = Sum(BoxValueA,BoxValueB,BoxValueC)var RemainValue = Maximum - BoxesValues // Check the current input and correct it if neccessaryif ($ < Minimum) then$ = Minimumelseif ($ > Maximum) then$ = RemainValueelseif ($ > RemainValue) then$ = RemainValueendif

Example form:
[url]https://acrobat.com/#d=FcnjwQ-7ia0hmRYCy1OAlw[/url]

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs