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

Javascript for a Validation

Participant ,
Nov 15, 2024 Nov 15, 2024

Hello again...

 

I have learned alot this week with incredible help from the community and I appreciate it.

 

I'm working on a field on PDF form and I'm trying to write a script for an amount that ends up as a negative number.  It seems the best way to address this would be to write a Validation script which would make the negative number return a 0 as the result.  Of course, the script that i came up with doesn't work.  It seems logical to think about doing it this way.  Here is Validation script that i attempted, if you have any thoughts that would once again be much appreciated.

 

if (event.value < 0) event.value = 0;

TOPICS
How to , JavaScript , Modern Acrobat , PDF forms
434
Translate
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
1 ACCEPTED SOLUTION
Community Expert ,
Nov 15, 2024 Nov 15, 2024

That script should do the trick. But why under Validation? If you're using a script for the calculation already, just add it there...

View solution in original post

Translate
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 ,
Nov 15, 2024 Nov 15, 2024

That script should do the trick. But why under Validation? If you're using a script for the calculation already, just add it there...

Translate
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
Participant ,
Nov 15, 2024 Nov 15, 2024
LATEST

Thank you for confirming!!

Translate
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