Expand my Community achievements bar.

SOLVED

Dynamic form help?

Avatar

Level 1

Hi All,

I am not very familiar with LiveCycle so I maybe using the product completely wrong (it came with my 'suite')....

I am trying to create an online form that provides different options for different users based on the way they answer specific questions....

To be more clear:

First user:

      DropDown menu (Choice A, Choice B, Choice C) ----> User selects Choice A

      Check box's offering (Option 1, Option 2, Option 3)

Second User:

      DropDown menu (Choice A, Choice B, Choice C) ----> User selects Choice B

      Check box's offering (Option 4, Option 5, Option 6)

And so on...

Is this possible with LiveCycle?

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

It is possible. There are different scenarios and different solutions. For example,

1) Captions, like data, can be populated dynamically when data is merged with a form. Go to Tools > Options > Data Binding and select 'Show Dynamic Properties'. You then view the properties for an object, go to the 'Field' tab, and click on 'Caption' to display the dynamic properties and data binding for the caption. A sample for caption binding was posted here last week.

2) Traditionally, when data is merged with a form template the PDF that is rendered can change based upon the contents of the data. In your case, there would be a subform for the first user and a different subform for the second user. Based upon the value(s) of the incoming data you would display one or the other.

3) Based upon some criteria in the form you can dynamically show and hide different objects.

4) Similar to point 3 you can dynamically change captions based upon a rule in the form. The attached PDF demonstrates a drop-down which drives the captions displayed for 3 checkboxes. If you select 'B' from the drop-down the checkbox captions change. If you select 'A' the captions reset.

So it is possible...but it depends on the problem you are trying to solve.

Steve

View solution in original post

5 Replies

Avatar

Correct answer by
Former Community Member

It is possible. There are different scenarios and different solutions. For example,

1) Captions, like data, can be populated dynamically when data is merged with a form. Go to Tools > Options > Data Binding and select 'Show Dynamic Properties'. You then view the properties for an object, go to the 'Field' tab, and click on 'Caption' to display the dynamic properties and data binding for the caption. A sample for caption binding was posted here last week.

2) Traditionally, when data is merged with a form template the PDF that is rendered can change based upon the contents of the data. In your case, there would be a subform for the first user and a different subform for the second user. Based upon the value(s) of the incoming data you would display one or the other.

3) Based upon some criteria in the form you can dynamically show and hide different objects.

4) Similar to point 3 you can dynamically change captions based upon a rule in the form. The attached PDF demonstrates a drop-down which drives the captions displayed for 3 checkboxes. If you select 'B' from the drop-down the checkbox captions change. If you select 'A' the captions reset.

So it is possible...but it depends on the problem you are trying to solve.

Steve

Avatar

Level 1

Hello-

Thank you for the response, your example is exactly what I want to do, but I am sorry I do not have any experience with LiveCycle and I don't know how to repeat what you did...

Could you explain how you made that form?

Avatar

Former Community Member

You're welcome. I have attached an Adobe Captivate recording of the form creation. Note, I cut and paste the script into the change event on the drop-down list to expediate the recording. The script did not come from somewhere magically.

Steve

Avatar

Level 1

Never mind I figured the problem out !

For anybody reading this with the same problem the "if statement" should read:

if

(xfa.event.newText == "B")

Avatar

Former Community Member

Just to elaborate on why that works and the previous example did not.....

You are using the change event....the value of the item that you selct in the list is not committed until you exit the field. As a result the value of the list is not correct and your test will always fall through to the default. When you use event.newtext you are getting the value you want then it is good to go.

Paul

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] ----