Skip to main content
Participant
Apr 3, 2017 12:37 PM UTC
Question

Text field question

HI,

I'm not sure what the proper etiquette is when asking questions. but here is what I want to do. When a number (this time a measurement) is entered in a text field (field_01) I would like a predetermined number to show up in another text field (field_02). The problem is the number in text field 1 would have to be between, for example greater that 50 and less than 100. Meaning when all numbers between 50 and 99 are entered in field 1 number is generated in field 2. And if a number is put in field 1 lets say, between 100 and 150, a different number is generated in field 2.

I hope this is making sense. I added a graphic. thanks so much.

This topic is closed to new replies. Start a new post to keep the conversation going.

3 replies

try67
Community Expert
Community Expert
Apr 3, 2017 12:49 PM UTC

You need to use conditional logic to do that: https://acrobatusers.com/tutorials/conditional-execution

Translate
try67
Community Expert
Community Expert
Apr 3, 2017 12:53 PM UTC

The basic code would be something like this (used as the custom calculation script of field_02):

var v1 = Number(this.getField("field_01").value);

if (v1>=50 && v1<=100) event.value = "22";

else if (v1>100 && v1<=150) event.value = "44";

else event.value = "";

I used dummy values since you didn't specify what you actually want it to be...

Translate
Participant
Apr 3, 2017 1:09 PM UTC

It worked. You have been so nice answering my silly questions. thank you so much.

Translate