Avatar

Level 3

sorry Malcolm...I need 1 more help from you man...been stuck on this today and couldnt figure this one out:

I am slightly modifying your script so the "+" button increases the sizes of fonts in all the textfields rather than just 1 textfield. In my form, I have a table with 1 Row and 5 columns. Each of these 5 columns has a Textfield inside each cell. Also these tables rows also have 3 or more instances. So I tried the following code and it only increases the font size of the first text field and not the textfields in other table columns nor the fields in their table instances...

//This code is for the "+" button

// get font size

var currentSize = xfa.resolveNode("xfa.form.form1.pageSubform.dynamicSubform.Table1.Row1.column1Subform.Textfield1").font.size;

// get location of the "pt" string

var ptPlace = currentSize.indexOf("pt");

// get the part of the string that is just numbers

var currentSizeInt = currentSize.substr(0,ptPlace);

// parse that new string as an integer and add 1

var newSizeInt = parseInt(currentSizeInt, 10) + 1;

// set that as the new font size ( adding the "pt" back on)

//and also do the same of all its instances.

//First counting the number of dynamic rows

var countRows = form1.pageSubform.dynamicSubform.Table1.Row1.instanceManager.count;

//loop to set new font size to this textfield and all its instances

for(var i=0; i<countRows; i++){

xfa.resolveNode("xfa.form.form1.pageSubform.dynamicSubform.Table1.Row1.column1Subform.Textfield1["+i+"]").font.size = newSizeInt + "pt";

//here doing the same for the textfields in other columns

xfa.resolveNode("xfa.form.form1.pageSubform.dynamicSubform.Table1.Row1.column2Subform.Textfield1["+i+"]").font.size = newSizeInt + "pt";

xfa.resolveNode("xfa.form.form1.pageSubform.dynamicSubform.Table1.Row1.column3Subform.Textfield1["+i+"]").font.size = newSizeInt + "pt";

xfa.resolveNode("xfa.form.form1.pageSubform.dynamicSubform.Table1.Row1.column4Subform.Textfield1["+i+"]").font.size = newSizeInt + "pt";

xfa.resolveNode("xfa.form.form1.pageSubform.dynamicSubform.Table1.Row1.column5Subform.Textfield1["+i+"]").font.size = newSizeInt + "pt";

}

All of these textfields has the same font size and dimension initially and I thought I can change the font size for all other text fields simply by adding the "newSizeInt" value to them. I tried it many ways but it doesnt work. Only the first textfield size changes and not the rest...can you help me plz? How can I modify this so the "+" button increases the size of the fonts in all the textfields in my table and its table instances?