Percentage field & calculation

New Here ,
Apr 15, 2022 Apr 15, 2022

Copy link to clipboard

Copied

Currently I created a PDF where consumers need to add in a decimal value instead of a percentage value for a calculation. I want consumers to be able to just add in a whole number "70" and be immediately transalated into "70%", but when I do that it converts into "7000%". Right now they have to add it as a decimal value in order to make the calculation work properly. Is there a simple script I can add to fix this problem?

TOPICS
How to , JavaScript , PDF forms

Views

48

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 15, 2022 Apr 15, 2022

Copy link to clipboard

Copied

As validation script of percentage field use this:

if(event.value)event.value = event.value/100;

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 16, 2022 Apr 16, 2022

Copy link to clipboard

Copied

LATEST

This pretty much defeats the purpose of a Percentage field... Just use a regular field and add the percentage symbol with a custom Format script, then.

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