Expand my Community achievements bar.

SOLVED

Switch Code Not Populating from Dropdown

Avatar

Former Community Member

I am using below code on exit property of dropdown (actual has about 4 locations/names).  The SiteMgr and SiteLoc fields are not populating when a selection is made.  The dropdown is in a subform named sfrmProjNo, it is located on the main/1st page of form.  Any ideas where I'm going wrong?  Thank you!

dataroot.#subform[0].Table1.Row1[1].sfrmProjNo.proj3dig::exit - (JavaScript, client)

switch (this.rawValue)

{

    case "ABC":

    SiteMgr.rawValue = "Name 1";

    SiteLoc.rawValue = "Location 1";

    break;

    case "DEF":

    SiteMgr.rawValue = "Name 2";

    SiteLoc.rawValue = "Location 2";

    break;

   

    case "GHI":

    SiteMgr.rawValue = "Name 3";

    SiteLoc.rawValue = "Location 3";

    break;

   

    case "JKL":

    SiteMgr.rawValue = "Name 4";

    SiteLoc.rawValue = "Location 4";

    break;

   

}

1 Accepted Solution

Avatar

Correct answer by
Level 5

Hi,

Where are the SiteMgr and SiteLoc fields in relation to the proj3dig field?

And it would be useful if you could upload a document ( using acrobat.com or dropbox.com  or something similar) so that we can see the code in context

Regards

Malcolm

View solution in original post

3 Replies

Avatar

Correct answer by
Level 5

Hi,

Where are the SiteMgr and SiteLoc fields in relation to the proj3dig field?

And it would be useful if you could upload a document ( using acrobat.com or dropbox.com  or something similar) so that we can see the code in context

Regards

Malcolm

Avatar

Level 5

Its may be because of wrong path for the fields.

SiteMgr ,SiteLoc fields are under the sfrmProjNo subform ? If they are not then

Try to give complete path for the fields.If it doesnt work As Malcolm told share the file so that we can have a look ..

Avatar

Former Community Member

Thank you, Malcom and Vjay, that was it!  No they are not in the subform, they are in a table.  The subform is in a cell inside the table.  When I changed them to below, it worked fine, thank you so much!

xfa.resolveNode("dataroot.#subform.Table1.Row2[1].SiteMgr")

xfa.resolveNode("dataroot.#subform.Table1.Row2[1].SiteLoc")