JavaScript
This group is focused on customization specifically using JavaScript. If you have cool tools and want... View more
Modifying Form Field .rect properties error
-
Modifying Form Field .rect properties error
I am trying to write simple code to reposition my form fields using (x, y) coordinates. I have a template where the form fields are sized and positioned correctly, and I am querying the console to find the true (x, y) of named form fields using this code:
var formField = getField(“FreefillType1-1”);
var rect = formField.rect;
console.println(rect);
This completes successfully on the good template, as well as the template I am trying to modify, but as soon as I try to change the .rect of anything with a dash, it gives me an undefined error:
var BOXTAG1 = getField(“BOXTAG1”);
var AirType1 = getField(“AirType1”);
var FreefillType1 = getField(“FreefillType1-1”);
BOXTAG1.rect = [790.6942749023438,737.7821655273438,972.76611328125,717.6009521484375]; //success
AirType1.rect = [790.6942749023438,716.6566772460938,972.7678833007812,696.47509765625]; //success
FreefillType1.rect = [605.5161743164062,695.4284057617188,789.7205810546875,675.246826171875]; //undefined
Steps I have taken in troubleshooting:
– verified field name, copied and pasted
-renamed the form field with an underscore instead of dash
-Used brackets around the form field name
The attached file is the one I am currently working on
Log in to reply.