Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

prepopulate dropdown using script object


Level 2
i have no java errors at all, my items have been prepopulated with only the first letter

in my dropdown i get







B and so on

this is my script object

form1.purchaseOrder.#variables[0].carparts - (JavaScript, client)

var carpart = new Array(new Array(243));

carpart[0] = " ";

carpart[1] = "AC Assembly Complete";

carpart[2] = "AC Compressor";


carpart[240] = "Windshield Washer Motor";

carpart[241] = "Wiper Motor Front";

carpart[242] = "Wiper Motor Rear";

// This function will populate the carpart Drop-down List.

// This function is called from the initialize event of the carpart Drop-down List.

function getcarpart(dropdownField)



for (var i=0; i < carpart.length; i++)




in my dropdown i have this

form1.purchaseOrder.details.detail.carpart1::initialize - (JavaScript, client)



if there is an easier way to prepolulate several identical dropdowns with the samne data i am willing to change my method

can anyone help
0 Replies


Level 6
I think it is the [0] in this line:

for (var i=0; i < carpart.length; i++) dropdownField.addItem(carpart[i][0]); }


Not applicable
As Bishop stated. You for loop for carpart is breaking the work into a character array, so you are attempting to reference the first character of the "i" array item.

The ultimate experience is back.

Join us in Vegas to build skills, learn from the world's top brands, and be inspired.

Register Now