Skip to main content
Known Participant
Sep 5, 2020 6:19 PM UTC
Answered

Two problems

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.

 

This topic is closed to new replies. Start a new post to keep the conversation going.
try67
try67Correct answer
Community Expert
Sep 5, 2020 7:58 PM UTC

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.

5 replies

try67
Community Expert
Community Expert
Sep 5, 2020 7:39 PM UTC

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?

Translate
MarietaaAuthor
Known Participant
Sep 5, 2020 7:49 PM UTC

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.

Translate
try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
Sep 5, 2020 7:58 PM UTC

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.

Translate