Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Can Designer Make forms that Calculate..Like Exell?

Avatar

Former Community Member
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?
12 Replies

Avatar

Former Community Member
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

Former Community Member
Thanks much Dave for the quick response, such a simple answer :)



Aaron

Avatar

Former Community Member
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

Former Community Member
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

Former Community Member
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

Level 2
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

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



allendavid@co.kane.il.us



Thanks in advance.

Avatar

Former Community Member
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!

Avatar

Former Community Member
I'd like a copy as well, send to my email address of soccerfan@imagenetusa.com

Thanks!

Avatar

Former Community Member
Can calculations be done if the "a" field is on page 1 and the "b" field is on page 2 and I want the answer to display on page 3 of a multipage form? Is there a way to reference a field on a different page?

Avatar

Former Community Member
Yes, you can do that Don. You just have to reference the full path to the field. So, for example, if fields a and b will be summed in c, and all fields are on the same page your script would be:



a + b



If they're on different pages of a form named form1 with subforms named sub1, sub2 and sub3, your script would be:



form1.sub1.a + form1.sub2.b