Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

help with populating fields

Avatar

Level 1

Hi all,

I'm having a little trouble with an if statement and I wondering if you can help. I'm creating a form where I would like text box field A to populate with information from fields B & C, only if fields D & E match. Below is my current statement. The form keeps getting stuck on the first if statement when all cases are true. Is there a way to have the statement continue even after one case is true (i.e. to make a list in text box A)? Any help is appreciated. Thanks!

//form1.DCF.Subform3.NSUFACULTY1::click:

if (form1.DCF.Subform3.PIACADEMICUNIT1==form1.FacePage.Subform1.PIACADEMICUNIT1) then

form1.DCF.Subform3.NSUFACULTY1=forms1.FacePage.Subform1.PINAME1

elseif (form1.DCF.Subform3.PIACADEMICUNIT1==form1.FacePage.Subform1.PIACADEMICUNIT1) then

form1.DCP.Subform3.NSUFACULTY1=form1.FacePage.Subform.NAME2

endif

3 Replies

Avatar

Former Community Member

There's a typo.

//form1.DCF.Subform3.NSUFACULTY1::click:

if (form1.DCF.Subform3.PIACADEMICUNIT1==form1.FacePage.Subform1.PIACADEMICUNIT1) then

form1.DCF.Subform3.NSUFACULTY1=forms1.FacePage.Subform1.PINAME1

elseif (form1.DCF.Subform3.PIACADEMICUNIT1==form1.FacePage.Subform1.PIACADEMICUNIT1) then

form1.DCP.Subform3.NSUFACULTY1=form1.FacePage.Subform.NAME2

endif

Avatar

Level 1

Thanks Steve. Is there anything else I could change? Even with the typo correction it isn't working....

Avatar

Level 7

I think you still don't have the full path. Try adding .rawValue to the end of your fieldnames, i.e.:

//form1.DCF.Subform3.NSUFACULTY1::click:

if (form1.DCF.Subform3.PIACADEMICUNIT1.rawValue==form1.FacePage.Subform1.PIACADEMICUNIT1.rawValue) then

form1.DCF.Subform3.NSUFACULTY1.rawValue=form1.FacePage.Subform1.PINAME1.rawValue

elseif (form1.DCF.Subform3.PIACADEMICUNIT1.rawValue==form1.FacePage.Subform1.PIACADEMICUNIT1.rawValue) then

form1.DCP.Subform3.NSUFACULTY1.rawValue=form1.FacePage.Subform.NAME2.rawValue

endif

Also, please double check that the scripting language is set to javascript.