7 Replies Latest reply on Jun 16, 2008 3:34 PM by kris_s

    addEventListener inside a for loop

    kris_s
      Attached is some code I have to create a number of TextArea and Text controls based on an input variable that will emulate columns. Each loop defines the TextArea (col) and Text (pCol) control properties and methods based on the iteration (i). Where I am running into problems is when I add an event listener to the TextArea.

      Instead of creating a different listener for each iteration (i.e., col1, col2, col3, etc.) the listener is being redefined. The result is that the final Text control built reflects any changes to the final TextArea control built; however, none of the other Text controls are updating on change of the corresponding TextArea.

      I am sure that I am missing something small here. Does anyone have any insight?

      Thanks in advance!