• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

330

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

Votes

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
Community Expert ,
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";

 

Votes

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
Community Expert ,
Apr 14, 2021 Apr 14, 2021

Copy link to clipboard

Copied

LATEST

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

Votes

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