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

Positioning an object at run time

Avatar

Level 2

Hi All,

I have a form where on selecting values from a drop down, certain fields should appear while a few should be hidden. I'm using scripting.

Explaining in detail:

When I select Value1 = Field A should appear and B should be hidden

When I select Value 2 = Fields A and B should appear (A appears above B)

When I select Value 3 = Field A should be hidden and B should appear (in this case, B should appear in the location where A was appearing) ----- This is my question  - How ?

Thanks & Regards,

Sandhya

0 Replies

Avatar

Level 10

This would be controlled through script. I created a sample for you. The original positions of the objects are relative to the container that they are in. In My example they are contained within a Page subform and that page subform is .25 inches from the edge of the page so you can calculated the position or simply use the command I have in the script (then print it out to the screen so you know its original position - I commented out the message).

Anyways, have a look and see if this is what you want .....BTW - I added those two line to make sure that I moved the field to the proper location .....they are not needed.

Hope that helps

Paul

Avatar

Level 2

Hi Paul,

The following  code is not working for me

//Return Field A to original position
var oAy = xfa.layout.y(FieldA, "in");
//app.alert(oAy)
FieldA.y = ".625in";

Maybe because FieldA in my case is a collection of 2 text fields and texts. I have wraped them in a subform. If I replace FieldA with the name of the subform, it is not working.

Is there any solution for that?

Thanks,

Sandhya

Avatar

Level 10

I would need to see the form in action ....can you send the form to LiveCycle8@gmail.com

Paul