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

Help! New to Adobe Livecycle Designer

Avatar

Level 2

Hello, I'm brand spanking new to Adobe's Livecylce Designer and hope you guys can help me out with this conundrum. I've created a drop down list and was hoping to add conditional logic to it.  In my drop down list, there's the option of choosing Yes or No and I wanted to have a text field displayed if the response is Yes.  If No, then nothing would be displayed.  Please help!  Thank you.

1 Accepted Solution

Avatar

Correct answer by
Former Community Member
You're welcome. If you would like a copy of the form, please send an email to stwalker.adobe@gmail.com.
Here are instructions to create the form.
1) if necessary, change the default form name to 'form1'
in the form Hierarchy click on the highest level object (the form root), press F2 and rename the object 'form1'
2) if necessary, change the default name of the page 1 sub-form from '(untitled Subform) (page 1)' to 'page1'
in the form Hierarchy click on '(untitled Subform) (page 1)', press F2 and rename the object 'page1'
3) drag a Drop-down List object onto the form
4) in the form Hierarchy click on the drop-down list, press F2 and rename the object 'dd'
5) drag a Text Field object onto the form
6) in the form Hierarchy click on the text field, press F2 and rename the object 'tf'
7) go to the text field Object properties (if Object properties are not visible go to the toolbar and click Window > Object)
on the Field tab go to the Presence drop-down and select 'Hidden (Exclude from Layout)'
8) go to the drop-down Object properties (if Object properties are not visible go to the toolbar and click Window > Object)
add List items to the drop-down by clicking the green plus sign and add the values 'Yes' and 'No'
9) click on the drop-down, either the visual representation or the drop-down object in the Hierarchy
10) go to the Script Editor (if the Script Editor is not visible go to the toolbar and click Window > Script Editor)
in the Script Editor 'Show' drop-down, change 'Events with Scripts' to 'exit'
with the Language set to 'JavaScript' and Run-at set to 'Client' add the script
if (this.rawValue == "Yes") {
  form1.page1.tf.presence = "visible";
}
else {
  form1.page1.tf.presence = "hidden";
}
11) save the form as a dynamic form
go to the toolbar, click File > Save As
give the form a File name
if necessary, change the 'Save as type:' to 'Adobe Dynamic XML Form (*.pdf)'
12) go to the form Preview (if Preview is not visible right-click on the Design View' tab and select 'Preview PDF')
13) test the drop-down
When you are done the form should (must) look like this...
Untitled.png
Steve

View solution in original post

4 Replies

Avatar

Former Community Member

The attached will do it for you. See exit event on drop-down.

// form1.page1.dd::exit - (JavaScript, client)


if (this.rawValue == "Yes") {

  form1.page1.tf.presence = "visible";

}

else {

  form1.page1.tf.presence = "hidden";

}

Steve

Avatar

Level 2

Can you please dumb this process down for me? I tried to imitate the process but wasn't too successful. How was the text field created and how was it linked to the drop down response? I also tried to copy the pdf you sent me but wasn't too successful either. Thanks again!

Avatar

Correct answer by
Former Community Member
You're welcome. If you would like a copy of the form, please send an email to stwalker.adobe@gmail.com.
Here are instructions to create the form.
1) if necessary, change the default form name to 'form1'
in the form Hierarchy click on the highest level object (the form root), press F2 and rename the object 'form1'
2) if necessary, change the default name of the page 1 sub-form from '(untitled Subform) (page 1)' to 'page1'
in the form Hierarchy click on '(untitled Subform) (page 1)', press F2 and rename the object 'page1'
3) drag a Drop-down List object onto the form
4) in the form Hierarchy click on the drop-down list, press F2 and rename the object 'dd'
5) drag a Text Field object onto the form
6) in the form Hierarchy click on the text field, press F2 and rename the object 'tf'
7) go to the text field Object properties (if Object properties are not visible go to the toolbar and click Window > Object)
on the Field tab go to the Presence drop-down and select 'Hidden (Exclude from Layout)'
8) go to the drop-down Object properties (if Object properties are not visible go to the toolbar and click Window > Object)
add List items to the drop-down by clicking the green plus sign and add the values 'Yes' and 'No'
9) click on the drop-down, either the visual representation or the drop-down object in the Hierarchy
10) go to the Script Editor (if the Script Editor is not visible go to the toolbar and click Window > Script Editor)
in the Script Editor 'Show' drop-down, change 'Events with Scripts' to 'exit'
with the Language set to 'JavaScript' and Run-at set to 'Client' add the script
if (this.rawValue == "Yes") {
  form1.page1.tf.presence = "visible";
}
else {
  form1.page1.tf.presence = "hidden";
}
11) save the form as a dynamic form
go to the toolbar, click File > Save As
give the form a File name
if necessary, change the 'Save as type:' to 'Adobe Dynamic XML Form (*.pdf)'
12) go to the form Preview (if Preview is not visible right-click on the Design View' tab and select 'Preview PDF')
13) test the drop-down
When you are done the form should (must) look like this...
Untitled.png
Steve

Avatar

Level 2

Steve, you are the Obi Wan Kenobi of Livecyle! A million thanks!!

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