var oFld;
for(var i=0;i<this.numFields;i++);
{
oFld = this.getField(this.getNthFieldName(i));
if(oFld.type == "checkbox");
{ oFld.size = "16";
}
else if(oFld.type == "radiobutton");
{ // Set new radio button parameters
}
}
SyntaxError: syntax error
1:Console:Exec
undefined
Here's a more functional set of code.
One of the problems that needs to be solved for this type of code is "How do you identify the specific fields that need to be changed". This code only uses the field type. But you may also need to use names or other characteristics.
var oFld,nCenterX, nCenterY;
// new width and height, These are 1/2 sizes because the code resizes the fields
// from the center.
var nHalfW = .2 * 36;
var nHalfH = .2 * 36;
for(var i=0;i<this.numFields;i++)
{
oFld = this.getField(this.getNthFieldName(i));
if((oFld.type == "checkbox") || (oFld.type == "radiobutton"))
{ // Set new radio button/checkbox parameters
// Find center
nCenterX = (oFld.rect[0] + oFld.rect[2])/2;
nCenterY = (oFld.rect[1] + oFld.rect[3])/2;
// Create new rectangle
oFld.rect = [nCenterX-nHalfW, nCenterY+nHalfH, nCenterX+nHalfW,nCenterY-nHalfH]
oFld.style = style.ch;
oFld.textSize = 12;
}
}