...

View Full Version : JS array population for a Drop-Down (basic)



Torvik
12-29-2007, 12:23 AM
So, I'm working with Adobe LiveCycle Designer which allows for programming with JavaScript. I'm not knowledgeable in the language, but I've been picking up things here and there.

I don't know how programming in LiveCycle is different from programming for the web. Hopefully this question will make sense here too. :)


I'm trying to populate a drop-down with a simple array of numbers, but I don't know how to make the array function work.

ex:

DropDown1 = Apple
DropDown2 = 1-20
DropDown1 = Orange
DropDown2 = 1-15

I'm using something like this:


if (this.rawValue == "apple") {
DropDown2.addItem(new Array(20));
if (this.rawValue == "orange") {
DropDown2.addItem(new Array(15));

Everything between

if (this.rawValue == "apple") {
DropDown2.addItem(

is right, but I don't know how to make the array work. Obviously something is missing, and I sure don't know what.
Is there a simple way where the array can populate itself?

Thanks so much!
Alan

oesxyl
12-29-2007, 01:40 AM
So, I'm working with Adobe LiveCycle Designer which allows for programming with JavaScript. I'm not knowledgeable in the language, but I've been picking up things here and there.

I don't know how programming in LiveCycle is different from programming for the web. Hopefully this question will make sense here too. :)


Is first time I heard about LiveCycle, so I don't know if that works but you can try since from what I read about it suport javscript, :D



I'm trying to populate a drop-down with a simple array of numbers, but I don't know how to make the array function work.

ex:

DropDown1 = Apple
DropDown2 = 1-20
DropDown1 = Orange
DropDown2 = 1-15

I'm using something like this:


if (this.rawValue == "apple") {
DropDown2.addItem(new Array(20));
if (this.rawValue == "orange") {
DropDown2.addItem(new Array(15));

Everything between

if (this.rawValue == "apple") {
DropDown2.addItem(

is right, but I don't know how to make the array work. Obviously something is missing, and I sure don't know what.
Is there a simple way where the array can populate itself?

Thanks so much!
Alan

f (this.rawValue == "apple") {
myapple = new Array(20);
for(i = 1; i<= 20; i++){
myapple[i] = i;
}
DropDown2.addItem(myapple);
}
[/code]

same thing for orange, :D

I hope this help you

best regards



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum