Hidden Subforms

Avatar

Avatar

Gene--O

Avatar

Gene--O

Gene--O

05-02-2013

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

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

yodadobe

Avatar

yodadobe

yodadobe

06-02-2013

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.

Answers (3)

Answers (3)

Avatar

Avatar

Gene--O

Avatar

Gene--O

Gene--O

06-02-2013

Thank you so much Steve!!!!

Avatar

Avatar

Gene--O

Avatar

Gene--O

Gene--O

05-02-2013

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!

Avatar

Avatar

yodadobe

Avatar

yodadobe

yodadobe

05-02-2013

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