Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Adding Pages to a Form

Avatar

Level 3

Hi,

I am attaching a survey-type form containing 13 statements: for each statement the user chooses from 5 radio button options, and a survey score appears at the end. Steve Walker, on this forum, help alot with this form (see: http://forums.adobe.com/thread/540343?tstart=0).

What I now need to do is add survey statements: the total number would be 36, not the 13 currently.

I have tried to add 2 pages to the form's page 1, so that page 2 has 13 more statements (14-26), and page 3 has 10 more (27-36) so the total on the 3 paqges is 36 statement. The "total" boxes on all 3 pages work OK to total and display each page's score. The difficulty I have is getting a grand total box on the 3rd page to show the total score for all 36 statements.

I've tried adding the individual page totals, but nothing populates into the grand total box:

pseudocode:

var grandtotal = total (on page 1) + total (on page 2) + total (on page 3).

I would appreciate any suggestions for getting this 13 statement form to become a 36 statement form.

Kind Regards,

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

The attached contains 3 pages with a total for each page and a grand total on page 3.

Steve

View solution in original post

3 Replies

Avatar

Level 10

Hi,

Steve's script for totaling the options/opinions is sweet!

Adding the three individual totals into a grand total is relatively straightforward. In the calculate event of the grand total field you would have the following in FormCalc (the SOM will depend on your naming convention for the pages and objects):

$ = page1.total + page2.total + page3.total

In Javascript it would look like this:

this.rawValue = page1.total.rawValue + page2.total.rawValue + page3.total.rawValue; 

If a total field was in a subform, then you would include the name of that subform in the script (eg page1.aSubForm.total). A handy way to reference objects in script is to click into the script editor and then press Control and click the object you want to reference. LC will insert the full SOM into the script for you.

Good luck,

Niall

Avatar

Correct answer by
Former Community Member

The attached contains 3 pages with a total for each page and a grand total on page 3.

Steve

Avatar

Level 3

Thanks Niall and Steve.

These gave me leads as to "how to" plus sophisticated scripting examples.

Your help is very much appreciated.

Kind Regards,

saratogacoach

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----