Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Hidden Subforms

Gene--O
Level 4
Level 4

Good Afternoon All,

I am not very familiar with subforms, so PLEASE help!

I have created a file with a drop down box called "Applicant Type". There are 4 possible values in this box: "Individual" "Partnership" "Assocation" and "Corporation".

I have created 4 subforms with corresponding names: "IndividualSub" "PartnerSub" "AssociationSub" "CorporationSub". All of these subforms are "hidden" in the Initialize Event of each one.

I am trying to create a script that makes the appropriate subform become visible when the corresponding option is selected from the drop down box.

I have inserted this script in the Change event of "Applicant Type" (FormCalc, Client):


if ($.rawValue==3) then IndividualSub.presence="visible" else IndividualSub.presence="hidden" endif

if ($.rawValue==2) then PartnerSub.presence="visible" else PartnerSub.presence="hidden" endif

if ($.rawValue==1) then AssociationSub.presence="visible" else AssociationSub.presence="hidden" endif

if ($.rawValue==0) then CorporationSub.presence="visible" else CorporationSub.presence="hidden" endif

The first time I activate the drop down, nothing happens. Each subsequent activation of the drop down makes one of the subforms appear, BUT, usually not the correct one. If I select "Corporation", I may get the "AssociationSub", etc.

I am using LiveCycle Designer ES2 v9

I would be glad to upload the file for anyone to look at, if you will provide me instructions on how to do so.

thanks in advance!

Gene-O

1 Accepted Solution
yodadobe
Correct answer by
Level 6
Level 6

if (event.newText=="Individual") then IndividualSub.presence="visible" else IndividualSub.presence="hidden" endif

if (event.newText=="Partnership") then PartnerSub.presence="visible" else PartnerSub.presence="hidden" endif

if (event.newText=="Assocation") then AssociationSub.presence="visible" else AssociationSub.presence="hidden" endif

if (event.newText=="Corporation") then CorporationSub.presence="visible" else CorporationSub.presence="hidden" endif

I am assuming the rest of your syntax was already correct. I rarely use FormCalc. I mostly use JavaScipt.

View solution in original post

4 Replies
yodadobe
Level 6
Level 6

Try using event.newText instead of $.rawValue which is giving you the old value.

Gene--O
Level 4
Level 4

thanks for your reply, BUT, I'm not familiar with this at all. Can you give me an example of how to insert it into my script?

thanks!

yodadobe
Correct answer by
Level 6
Level 6

if (event.newText=="Individual") then IndividualSub.presence="visible" else IndividualSub.presence="hidden" endif

if (event.newText=="Partnership") then PartnerSub.presence="visible" else PartnerSub.presence="hidden" endif

if (event.newText=="Assocation") then AssociationSub.presence="visible" else AssociationSub.presence="hidden" endif

if (event.newText=="Corporation") then CorporationSub.presence="visible" else CorporationSub.presence="hidden" endif

I am assuming the rest of your syntax was already correct. I rarely use FormCalc. I mostly use JavaScipt.

View solution in original post