Highlighted

Two problems

Explorer ,
Sep 05, 2020

Copy link to clipboard

Copied

Hi, I have two problems.

1. How to stop value from increase? if value reach 8 I want to stop it there from increase further.

2. In my text fields font size is set to auto but it doesn't work.

As usual thanks in advance for helping.

 

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

1. Change it to:

if (Number(this.getField("Text12").value)<8)

this.getField("Text12").value += 1;

2. After changing the font size you have to also change the text for it to update.

TOPICS
Acrobat SDK and JavaScript, How to

Views

40

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

Two problems

Explorer ,
Sep 05, 2020

Copy link to clipboard

Copied

Hi, I have two problems.

1. How to stop value from increase? if value reach 8 I want to stop it there from increase further.

2. In my text fields font size is set to auto but it doesn't work.

As usual thanks in advance for helping.

 

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

1. Change it to:

if (Number(this.getField("Text12").value)<8)

this.getField("Text12").value += 1;

2. After changing the font size you have to also change the text for it to update.

TOPICS
Acrobat SDK and JavaScript, How to

Views

41

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
Sep 05, 2020 0
Most Valuable Participant ,
Sep 05, 2020

Copy link to clipboard

Copied

1. You need to be a bit more specific than that... Are you talking about a form field? If so, how is it increasing, exactly? Are you using a script to do it directly, or is it a calculation? How is it set up, etc.?

2. What does that mean, exactly? Does the font size not change as you enter more text in to it? If not, then what happens?

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
Reply
Loading...
Sep 05, 2020 0
Explorer ,
Sep 05, 2020

Copy link to clipboard

Copied

1. Value is increased from button click, this code is used as button mouseUp:

this.getField("Text12").value += 1;

2. Text doesn't resize to field size.

Izrezak.PNG

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
Reply
Loading...
Sep 05, 2020 0
Most Valuable Participant ,
Sep 05, 2020

Copy link to clipboard

Copied

1. Change it to:

if (Number(this.getField("Text12").value)<8)

this.getField("Text12").value += 1;

2. After changing the font size you have to also change the text for it to update.

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
Reply
Loading...
Sep 05, 2020 0
Explorer ,
Sep 05, 2020

Copy link to clipboard

Copied

1. That worked thank you.

2. I turned off Rich text formatting and that helped.

It's not possible to have rich text formatting and auto size?

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
Reply
Loading...
Sep 05, 2020 0
try67 LATEST
Most Valuable Participant ,
Sep 05, 2020

Copy link to clipboard

Copied

2. Unfortunately, no.

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
Reply
Loading...
Sep 05, 2020 0