Skip to main content
stepheng54012748
Known Participant
November 15, 2024
Answered

Javascript for a Validation

  • November 15, 2024
  • 1 reply
  • 582 views

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;

This topic has been closed for replies.
Correct answer try67

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

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
November 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...

stepheng54012748
Known Participant
November 15, 2024

Thank you for confirming!!