Setting custom messages to values

New Here ,
Apr 13, 2021 Apr 13, 2021

Copy link to clipboard

Copied

Hello! I'm a graphic designer with not much coding experience. I'm designing a pdf form, but I'm trying have a field display a specific code, depending on a number value. Example: If the value is 0.8, I want the field to display 'Code 1A'. If the value is 0.95, I want the field to display 'Code 1B'. Any ideas?

 

TOPICS
JavaScript, PDF forms

Views

85

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
Adobe Employee ,
Apr 13, 2021 Apr 13, 2021

Copy link to clipboard

Copied

Hi David

 

Hope you are doing well and sorry for the trouble. As described you want to have a field display a specific code, depending on a number value.

 

The workflow you are trying to achieve is possible using the JavaScript. For more information please check out the help page https://www.adobe.com/content/dam/acom/en/devnet/acrobat/pdfs/js_developer_guide.pdf and see if that works for you.

 

Regards

Amal

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
Adobe Community Professional ,
Apr 13, 2021 Apr 13, 2021

Copy link to clipboard

Copied

As validation script of that field you can use this basic code:

if(event.value == 0.8)
event.value = "Code 1A";
else if(event.value == 0.95)
event.value = "Code 1B";

 

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
Most Valuable Participant ,
Apr 14, 2021 Apr 14, 2021

Copy link to clipboard

Copied

LATEST

Do you mean the same field, or a different one?

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