using rect distorts text in box

New Here ,
Feb 15, 2018 Feb 15, 2018

Copy link to clipboard

Copied

I am trying to have a  drop down menu resize based on the selection chosen.  I am able to resize it, but the text in the box does not refresh when the box is resized.  If I choose the same option twice, the text looks normal, but on first choice, the text is misshapen.  It also looks different when I mark the form as read only as well.

1.png

2.png

3.png

4.png

This is the code that I am using:

if (event.value == "Add Restitution in the amount of:") {

this.getField("note1").display = display.visible;

this.getField("note9").display = display.hidden;

var b = this.getField("Dropdown1");

var aRect = b.rect;

aRect [2] = 245.26;

b.rect = aRect;

}

else if (event.value == "Increase:") {

this.getField("note1").display = display.hidden;

this.getField("note9").display = display.visible;

var b = this.getField("Dropdown1");

var aRect = b.rect;

aRect [2] = 141.2;

b.rect = aRect;

}

else if (event.value == "Decrease:") {

this.getField("note1").display = display.hidden;

this.getField("note9").display = display.visible;

var b = this.getField("Dropdown1");

var aRect = b.rect;

aRect [2] = 141.2;

b.rect = aRect;

}

else if (event.value == "Other / Items:") {

this.getField("note1").display = display.hidden;

this.getField("note9").display = display.visible;

var b = this.getField("Dropdown1");

var aRect = b.rect;

aRect [2] = 141.2;

b.rect = aRect;

}

This is the file if you would like to vew it for your self. Its uploaded to google drive.

https://goo.gl/s5bvhs

Thanks in advance!

TOPICS
Acrobat SDK and JavaScript

Views

107

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct Answer

Most Valuable Participant , Feb 15, 2018 Feb 15, 2018
After changing the field's size, re-apply the value to it, like this:var oldValue = b.value;b.value = b.defaultValue;b.value = oldValue;[Edit: Fixed a mistake in the last line of the code]

Likes

Translate

Translate
Most Valuable Participant ,
Feb 15, 2018 Feb 15, 2018

Copy link to clipboard

Copied

After changing the field's size, re-apply the value to it, like this:

var oldValue = b.value;

b.value = b.defaultValue;

b.value = oldValue;

[Edit: Fixed a mistake in the last line of the code]

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 16, 2018 Feb 16, 2018

Copy link to clipboard

Copied

LATEST

Thank you so much!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines