Can Designer Make forms that Calculate..Like Exell?

Avatar

03-01-2007

I am wondering if it is possible to make a form that will total several user inputted values. Such as a Travel Expense Report, that will total the miles driven and then give an answer, both total number of miles driven and the total amount of reimbursement.



Thanks,

Aaron



If this is possible can someone explain how it is done please?

Replies

Avatar

03-01-2007

Yes, you can do that. If you want to add two fields named a and b together, put this script in the calculate event of the field the total will go into and make sure you select JavaScript:



this.rawValue = (a.rawValue) + (b.rawValue);



Regards,

Dave

Avatar

03-01-2007

Thanks much Dave for the quick response, such a simple answer 🙂



Aaron

Avatar

28-06-2007

Dave,



how about if I want a field to add two values I input in the same field like excel will do entering in the cell "=a+b"?



I am building an Expense Report and I would like users to enter multiple amounts (each expense) for the same day and category.



Is there a way to do so with Designer?

Thanks

Marco

Avatar

28-06-2007

To add to Davids solution, you can make it act more like Excel by selecting FORMCALC instead of Javascript. Also, by using FORMCALC, then only have to enter the following script:



a+b



That's as close as you can get to Excel.



This also works too:

this = a + b

this = a.rawvalue + b.rawvalue

Avatar

Avatar

gkaiseril

Avatar

gkaiseril

gkaiseril

28-06-2007

For the use of controlled field names or loops see:



http://forms.stefcameron.com/category/formcalc/

Avatar

29-06-2007

I agree with Scott in that Formcalc is much easier to use as the formula's look more similar to Excel formula's. However, if you have multiple scripts in the same event, you can only use one language so I try to put everything in JavaScript in case I need to add some other functionality later. Having said that, Adobe Forms are not Excel. You can emulate certain features, but not all. And to do what you're asking Marco, while it may be possible (although I'm not sure) you'd probably spend a couple of weeks chasing down the scripting to get it to act the way you want. My best advice is to keep it to simple calculations only.

Avatar

Avatar

kimbradford

Avatar

kimbradford

kimbradford

29-06-2007

Hi,



I just finished creating an Employee Expense Form for a client, and using FORMCALC and it was pretty straightforward and simple to do. If you like, I can send you a copy of what I created.

Avatar

29-06-2007

Hi Kim, could I get a copy as well? My email is:



allendavid@co.kane.il.us



Thanks in advance.

Avatar

03-07-2007

Hi! I'm new to this as well and I have been trying to enter a FORMCALC formula based on LiveCycle's help file. I'm obviously missing something as I can only get the first cell value to 'add' in my total cell. This is all in a table... Anyway, can I get a copy as well? It sounds like you have accomplished what I have been trying to. My e-mail address is cheri.wright@dominionenterprises.com. Thanks so much!