Ask a Question related to Adobe Acrobat Macintosh, Design and Development.
-
Joel_Dryden@adobeforums.com #1
if, then form calculations...stumped
I'm working with a financial application form. I have the following fields:
"number of loans"
"new loan set up"
My client wants a calculation in the "new loan set up" that would multiply the "number of loans" field by "150" and determine if the sum is lower than "637.50" then the value is "0" or if the value of the sum is greater then the amount would equal the sum.
I have a hidden field "loans multiplied" that uses a calculation to multiply "number of loans" by "150"
here is the script:
var a = this.getField("number of loans")
event.value = (a.value*150)
Below is what I put together, but I'm a designer, not a "script-tease" Somebody please help me!
var a = this.getField("loans multiplied");
{
if(a.value <= "637.50") event.value = "0"; else if(a.value >= "637.50")
event.value = a.value;
}
Joel_Dryden@adobeforums.com Guest
-
Calculations in a form
Forgive me, but I'm new at this. I was given an excell file to place in Acrobat to create a form. There are two colums that will have numbers in... -
Editing Existing Form with Calculations
Hi, A previous designer built an order form calculating subtotals and totals from user-entered data. I wanted to add one more radio button set,... -
Date calculations from FORM field
Hello everyone, I am trying to build a site for my company that to replace our current leave request database. This is how I would like the site... -
Form Design with numeric calculations
Am new to Flash! Am trying to design a form that will allow user input for general information, selection of items, sub-totaling and totaling of... -
Could someone have a look at my .fla please. I'm stumped!
Okay firstly heres the .swf of what im trying to do http://www.happylobster.co.uk/flash/flashtester.swf Basically I have 2 Scenes, each with a... -
George_Johnson@adobeforums.com #2
Re: if, then form calculations...stumped
Remove the quotes around the values:
if (a.value < 637.50) event.value = 0;
else event.value > 637.50;
With the quotes, the values are being compared as strings, not numbers like you want. And there is no need for the opening and closing curly braces for this block of code.
It sounds like you're muliplying two integers (number of loans * 150), so the result will never be equal to 637.5, so the above code should work.
You may not need to have that intermediate calculated field at all, and simply change the code to:
var v1 = 150 * getField("number of loans").value;
if (v1 < 637.5) event.value = 0;
else event.value = v1;
George
George_Johnson@adobeforums.com Guest
-
Joel_Dryden@adobeforums.com #3
Re: if, then form calculations...stumped
Works, Thanks George!
Joel_Dryden@adobeforums.com Guest
-
George_Johnson@adobeforums.com #4
Re: if, then form calculations...stumped
BTW, that should have been:
if (a.value < 637.50) event.value = 0;
else event.value = a.value;
George_Johnson@adobeforums.com Guest



Reply With Quote

