2 Replies Latest reply on Sep 25, 2014 1:00 AM by jhon milz

    button to associate the array volar

    jhon milz

      I'm sorry but I have a new doubt, give me a hand to write a function that inserts in 3 textbox data from a data array which should be associated with some buttons.

       

      for example i have a 5 buttons, 1. name "AL1", 2. name "AL2", ecc.

      array is

       

      var cod = new Array();

      cod ["AL1"] = ["Text1", 123, 45];

      cod ["AL2"] = ["Text2", 345, 89];

      cod ["AL3"] = ["Text3" 987, 143];

      cod ["AL4"] = ["Text4", 098, 765];

      cod ["AL5"] = ["Text5", 988, 89];

       

      and 3 text box name Textbox1, Textbox2, Textbox3, and I wanted to know if it was possible to associate the button array that its event enters the values of the array in textbox

      I hope that I did understand. Sorry for my bad English, but I use google translator.

        • 1. Re: button to associate the array volar
          George_Johnson MVP & Adobe Community Professional

          It's not clear to me what you want to do. You are not using an array correctly though, and should be using an object instead, like this:

           

          var cod = {};

          cod ["AL1"] = ["Text1", 123, 45];

          cod ["AL2"] = ["Text2", 345, 89];

          cod ["AL3"] = ["Text3" 987, 143];

          cod ["AL4"] = ["Text4", 098, 765];

          cod ["AL5"] = ["Text5", 988, 89];

           

           

          If you can provide more information, I'll try to help. You say you want to enter the values of the array (e.g., ["Text1", 123, 45]) into a text box, but you need to explain how you would like that done.

          • 2. Re: button to associate the array volar
            jhon milz Level 1

            Meanwhile, thank you very much for your interest, then I'm making a sort of catalog where every product has a button to click and go to add the description of the product in some textbox, but since the catalog contains many products, I wanted to create a function that used an array as the database and that would combine the value based on the name of the button, so that in the future you have the option to extend the catalog by simply adding more buttons and entering new values in aray

             

             

            name button AL1 AL1 data array = ["description", 1100], and click to insert the data in the array of textbox

            I hope I was clear

            thanks