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?
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
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";
Copy link to clipboard
Copied
Do you mean the same field, or a different one?