7 Replies Latest reply on Mar 22, 2015 12:07 PM by Jim MacD

    Getting 'insertItemAt is not a function' Error Message

    Jim MacD

      I am using abode pro 8 and am getting a 'insertItemAt is not a function' error message using the following code. (This code below was written as an example to show the process I want - I want to clear a combo box, then add data to it.)

       

      The error message only appear in a one of my pdf's I currently use, otherwise it works as written. Because I want the data to appear listed from top to bottom within the combo box from 1 to 5, I insert 5 first. 5 gets inserted, but when the code tries to insert 4, it trippers the error message. Any thoughts - is there another way to insert data into a combo box?

       

       

       

       

      var i = 0;

      var ii = 5;

      var v = new Array();

       

      v[1] = 1;

      v[2] = 2;

      v[3] = 3;

      v[4] = 4;

      v[5] = 5;

       

      //Combo Box

      this.getField("Fund Company-Long-Name").clearItems();

      var a = this.getField("Fund Company-Long-Name");

       

      for (var i= ii;  i > 0; i--)

                   {

                   if(v[i] != undefined)

                               {

                               app.alert(i);      

                               a.insertItemAt(v[i], (i, ""));

                               }

                   }

       

      v[0] = " ";

       

       

      a.insertItemAt(v[0], (0, ""));

      this.getField("Fund Company-Long-Name").value = " ";  

       

       

      //================Gives this error message=============

       

      Acrobat Database Connectivity Built-in Functions Version 8.0

      Acrobat EScript Built-in Functions Version 8.0

      Acrobat Annotations / Collaboration Built-in Functions Version 8.0

      Acrobat Annotations / Collaboration Built-in Wizard Functions Version 8.0

      Acrobat Multimedia Version 8.0

      Acrobat SOAP 8.0

       

      a.insertItemAt is not a function

      4:Field:Mouse Down