Quantcast
Channel: Adobe Community : Popular Discussions - JavaScript
Viewing all articles
Browse latest Browse all 12130

For loop not working

$
0
0

Hi Everyone,

 

I am trying to use a simple for loop and it is not working. I have a group of drop down boxes that I have named Dropdown.A - Dropdown.F

 

I am able to make it into an array using:

 

var Dropdown = this.getField("Dropdown").getArray();

 

however when I try and loop over the array using:

 

for (i = 0; i < Dropdown.length; i++){

   console.println(Dropdown[i].name);

}

 

I get "Dropdown[i] is undefined" so it seems like the i is never being replaced by the correct number when looping.

 

Has anyone ever seen this or know why this is happening?

 

Thanks,

 

Mike


Viewing all articles
Browse latest Browse all 12130

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>