Have a button in adobe [Acrobat] that adds a row of columns, then adds another row below it.
I am trying to get a button on a fillable PDF Form that will keep adding new rows of 4 text fields below the ones it prevously made.
My code for my first row is:
var myRows = new Array();
myRows[0] = "Row1.Column1";
myRows[1] = "Row1.Column2";
myRows[2] = "Row1.Column3";
myRows[3] = "Row1.Column4";
var coordinates= [10,136];
var w = 144;
var h = 18;
var wGap = 6;
var afields= [coordinates[0], coordinates[1], coordinates[0]+w, coordinates[1]-h];
this.addField(myRows[0], "text", 0, afields);
for (var i=1; i<myRows.length; i++)
{
afields[0] += (w+wGap);
afields[2] += (w+wGap);
var f = this.addField(myRows[i], "text", 0, afields);
}
This code makes 4 text fields in a straight line across the page. I would like to click the same button a second time to add the same number of fields below them, and have it so the more you click on it, it just keeps adding a row of fields again and again.
Is this possible, or should I approach this another way?
["Acrobat" added to title for clarity, as "Adobe" is a company. Post tagged with PDF Forms and JavaScript.]
