Skip to main content
olivern10692170
Participant
July 15, 2020
Answered

PDF-Formular Berechnung (Textfeld): Wenn die Zahl 0 ist,, dann Feld leer lassen

  • July 15, 2020
  • 4 replies
  • 6222 views

Hallo Zusammen

 

Ich habe mein erstes PDF-Formular mit Acrobat Adobe erstellt. Dazu habe ich unter Textfeld-Eigenschaften/Berechnung die Option Wert ist Produkt (x) verwendet.

Soweit so gut, nun würde ich mir aber wünschen, dass nur eine Zahl ausgegeben wird, wenn diese nicht 0 (Null) ist. Dies heisst, ist die Zahl Null so soll das Feld einfach leer stehen und nicht die Zahl Null ausgeben. Ist dies überhaupt möglich und wenn ja wie?

 

Besten Dank im Voraus für die Unterstützung

Oliver

This topic has been closed for replies.
Correct answer JR Boulay

"As the custom validation code of the field enter this:

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

 

"The only disadvantage is, that i have to get my (big) sum formula also to Java, because i can´t use the field selection and additional a custom code."

 

You should use this script as a "Custom Format Script" instead of a "Custom Validation Script" because the Format script only modifies the display in the field, it does not change its real value which is always zero and therefore remains usable for further calculations.

 

4 replies

JR Boulay
Community Expert
JR BoulayCommunity ExpertCorrect answer
Community Expert
March 2, 2022

"As the custom validation code of the field enter this:

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

 

"The only disadvantage is, that i have to get my (big) sum formula also to Java, because i can´t use the field selection and additional a custom code."

 

You should use this script as a "Custom Format Script" instead of a "Custom Validation Script" because the Format script only modifies the display in the field, it does not change its real value which is always zero and therefore remains usable for further calculations.

 

Acrobate du PDF, InDesigner et Photoshopographe
Participant
March 4, 2022

Thank you very much. That safed my day 😉

 

 

Participant
March 2, 2022

Hallo ist das immernoch eine gültige Lösung? ich gebe es hier in ein PDF Formular ein aber es passiert nichts. 

Viele Grüße

 

Bernd Alheit
Community Expert
Community Expert
March 2, 2022

Where does you use the script?

Participant
March 2, 2022

I don't understand the question. It's a contract sheet. I want to use it on Computer with windows.

try67
Community Expert
Community Expert
March 13, 2021

As the custom validation code of the field enter this:

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

Participant
March 21, 2021

Thank you, works perfect.

The only disadvantage is, that i have to get my (big) sum formula also to Java, because i can´t use the field selection and additional a custom code. The one or the other....  

But thats nice to get practice ..... 😉

 

 

Participant
March 13, 2021

Die Frage stellt sich mir auch, weiß niemand eine Lösung ?

LG

Ingrid