• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
33

Please help with JS for dropdown

New Here ,
Nov 09, 2023 Nov 09, 2023

Copy link to clipboard

Copied

Hello, I have very little experience with JS and im trying to learn on my own as much as i can, I am trying to see how i can have multiple variables on a cascading drop down

 

 

var Itemlist = this.getField("Dropdown1","Dropdown2);

if(event.willCommit)
{
switch(event.value){

 

case "O2 Concentrator":
Itemlist.setItems([" ","No Filter","4-Way Valve","4-Way Valve Rebuild","4-Way Valve Rebuild (w/end caps)","4-Way Valve Rebuild (w/gasket)","4-Way Valve Rebuild (w/end caps & gasket)"]);

 

break;

 

case "Lift":


Itemlist.setItems([" ","2-Channel Hand Pendant","4-Channel Hand Pendant","Sling Clips (pck of 6)","Boot Boom","Emergency Pull Pin","Stop Button (Control Box)"]);

break;

 

case " ":
Itemlist.setItems([""]);

break;

}

}

TOPICS
Create PDFs , Edit and convert PDFs , JavaScript , Modern Acrobat , Modern Viewer , PDF , PDF forms

Views

181

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Nov 09, 2023 Nov 09, 2023

This is not valid:

var Itemlist = this.getField("Dropdown1","Dropdown2);

 

You need to treat each field on its own:

var Itemlist1 = this.getField("Dropdown1");

var Itemlist2 = this.getField("Dropdown2");

Votes

Translate

Translate
Community Expert ,
Nov 09, 2023 Nov 09, 2023

Copy link to clipboard

Copied

This is not valid:

var Itemlist = this.getField("Dropdown1","Dropdown2);

 

You need to treat each field on its own:

var Itemlist1 = this.getField("Dropdown1");

var Itemlist2 = this.getField("Dropdown2");

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 12, 2023 Nov 12, 2023

Copy link to clipboard

Copied

LATEST

Thank you so much! 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines