3 Replies Latest reply on Sep 14, 2011 9:36 AM by jfb00

    Get values from dynamic form items

    jfb00 Level 3

      Hi All,

      I create a dynamic form with text input component

      private function buildForm():void{
                      var numberOfColumns:Number = 5
                      var formItem:FormItem = new FormItem();
                      var hBox:HBox = new HBox();
                      for(var i:Number=0; i< numberOfColumns; i++) {
                          var formInput:TextInput = new TextInput();
                          formInput.text = "test";
      formInput.id = "txt_" +i;                     hBox.addChild(formInput);                 }   
      formItem.addChild(hBox);                 loansForm.addChild(formItem);

      I can see the text input components, update the values.

      How can I get the updated values from the input components?

      I try  this["txt_" + i].text  but not working. It's not finding the component with the dynamic value.

      Any ideas?