Skip to main content
Participant
May 6, 2020
Question

"Masterlist" in javascript

  • May 6, 2020
  • 2 replies
  • 548 views

I just got my fingers on javascript and my first step was to create my own form by adapting the example file in this tutorial:
https://acrobatusers.com/tutorials/js_list_combo_livecycle/index.html#
In the example the masterlist contains three information: assembly, parts and price.
The partslist in the second dropdown depends on the assembly selection in a first dropdown. The Price shown depends on the selection in the second dropdown.
What I'm struggling with is that I need a fourth information, lets call it "color", in the masterlist.
How do I have to extend the masterlist or is the idea tottaly wrong? Just adding the additional infromation in brackets obviously doesn't work at all.

example from the tutorial:
var oAssemblyParts = { Chasis: [ ["-","None"],["Rear Bracket",205.95],

A hint in which direction to work would be great. Thank you all.

 

This topic has been closed for replies.

2 replies

try67
Community Expert
Community Expert
May 6, 2020

Why not? That's exactly what you should do.

So this:

Chasis: [
		["-","None"],
		["Rear Bracket",205.95],
		["Front Bracket",185.95],
		["Long Support",44.95],
		["Front Bearing",48.95]

 

can become something like this:

 

Chasis: [
		["-","None", "None"],
		["Rear Bracket",205.95, "Red"],
		["Front Bracket",185.95, "Green"],
		["Long Support",44.95, "Blue"],
		["Front Bearing",48.95, "Black"]
Participant
May 7, 2020

That was my first attempt but made a mistake because in some place the value for "price" ist text. My seperation was incorrect. I used quotationmarks for each value. It works if you put is as a package in quotes, seperated by a comma.
The solution came from the tutorials author in a similar question that I found by accident.
https://answers.acrobatusers.com/using-event-changeEx-q40824.aspx

Thank you for your help.
Problem solved

Bernd Alheit
Community Expert
Community Expert
May 6, 2020

What should happen at selecting "color" in the masterlist?

Participant
May 7, 2020

The "color" value needs to be inserted in several different places in the form. So it has to seperated from the price value in some way.