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

Need help populating a text box from a drop-down list.

Avatar

Level 2

I think I have most of the code and settings correct, but I need some help.

I have a drop-down list that is populated with 3 states. When a certain state is selected from the drop-down list, I need a text box to populate with the appropriate tax info for each state. I have the list variables set up that define the data for the drop down list and the data I want to appear in the text box. I also have some of the basic javascript code in place -- but it's not perfect.

The problems I'm having with the resulting dynamic .pdf file include:

1. When a state is selected from the drop down list, the user has to click the text box first in order for the appropriate text to show up in the box.

2. When a state is selected from the drop down list and the user clicks the text box to display the tax info text, the tax info text does not change as it should if a user selects a different state from the drop down list.

3. The tax info in the text box will not even show up for 2 of the states (is this because the list variable I have set up for these states has too many text characters? Is there a way around this limitation?)

Can anyone help me tweak the javascript code and settings I am using to make the text field populate properly? This is the first livecycle project I've even tried and my first experience with javascript.

Here is the file I am working on:

http://www.filedropper.com/outofstatetaxtemplate2

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

Just came across this sample chapter from Peachpit Press that talks about just what you're trying to do.

http://www.peachpit.com/articles/article.aspx?p=1021020&seqNum=4

They even provide a sample download to examine the code. Change the numeric field to a text field and you're all set.

View solution in original post

1 Reply

Avatar

Correct answer by
Former Community Member

Just came across this sample chapter from Peachpit Press that talks about just what you're trying to do.

http://www.peachpit.com/articles/article.aspx?p=1021020&seqNum=4

They even provide a sample download to examine the code. Change the numeric field to a text field and you're all set.

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