I have a drop down list that is NOT populated via XML, so what I have it doing now is populating a DiscountPercentage numeric box with a set number depending who's name has been selected.
What I would like to happen is limit this DiscountPercentage box to a set number based on the person who's name has been selected from the drop down box.
So...
RepName = Drop down box
DiscountPercentage = The amount of discount applied to a price in a table
In a nutshell, if you were to select "Jane Doe" as a person from RepName, she would be entitled to give a 10% discount or less. If she was to put for example the number 15 in DiscountPercentage, the DiscountPercentage would look at who's name has been selected from RepName, and adjust the DiscountPercentage back to 10 vice the 15 she put in the box.
I know this must involve an if else statement, but I can't seem to get this to work. BTW, I only have around 12 reps or so, so it shouldn't be too difficult to do. Thank you.
Set the language to JavaScript.
It should look something like this. The "MaxPercent" Field is the output from the dropdown list. You're field names will be different .
if(this.rawValue > MaxPercent.rawValue)
this.rawValue = MaxPercent.rawValue;
true;
The last "true" statement is necessary to keep the validate funtion from throwing an error message at the user.
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script