Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Remove "in" units from X Coordinates

Not applicable
Does any know how to remove the "in" units from an x coordinate?
7 Replies
pguerett
Level 10
Level 10
Not sure I follow ....do you want to work in different units?
Not applicable
When I get the X coord for an object in script. Text1.x it returns 2in but i need to take that value (without the units "in") and add a value to it.



Also, I am having some difficuly getting the width value of a textbox that expands to fit.



I want to position a help button after a textbox. I want to know the position of the textbox and the width. So i can set the X value of the help button.



Thanks,
pguerett
Level 10
Level 10
I have an example of this on another computer that I cannot get to until next Tuesday....I will post the example then.
Not applicable
Sick.. I figured it out. Wrap the expandable text and help button in a subform and make the content Flowed - Western text.
pguerett
Level 10
Level 10
That is not the way I would do it.

Here is some code that will give you the length of the field after rendering. You can change the units to any supported value at it will work fine. Note that this is javascript.



var oH = xfa.layout.w(txtDescription, "in");

this.w = oH + "in";



where txtDescription is the name of the field that you want to get the length of. This code wouldl be executed in the layout event of the object that you are trying to position.



Hope this helps
Not applicable
Would I be able to get the x/y coords as well by this approach?

xfa.layout.x(txtQuestion,"in");

xfa.layout.y(txtQuestion,"in");
pguerett
Level 10
Level 10
Yes..that woudl be the absolute positioning after layout (useful in a flowed form). Not the x and y at Design time like in a static form.