Skip to main content
Formbeginner
Known Participant
June 5, 2024
Answered

Nicht drucken, wenn Textfeld leer

  • June 5, 2024
  • 1 reply
  • 1352 views

Hallo liebe Community,

ich erstelle ein Formular direkt aus Adobe Acrobat Pro heraus.

 

Es enthält ein Textfeld, das folgendes Verhalten haben soll:

Wenn das Textfeld vom Anwender nicht ausgefüllt wird oder versehentlich eingegebener Inhalt wieder gelöscht wird, sollen zwei daneben stehende statische Texte nicht ausgedruckt werden, aber am Monitor sichtbar bleiben.

 

Hat jemensch eine Idee, wie man das am einfachsten umsetzten kann? Ich wäre überglücklich!!!

 

 

This topic has been closed for replies.
Correct answer PDF Automation Station

Field names:  "Entry" (the field the text will entered), "Static1", "Static2".

1)  Set the default values (in the options tab of the field properties) of Static1 and Static2 to the text that should be in them.

2)  Set them to Read Only (in the General tab) of the field properties.

3)  Enter the following custom validation script in the Entry field:

if(event.value)
{
this.getField("Static1").display=display.visible;
this.getField("Static2").display=display.visible;
}
else
{
this.getField("Static1").display=display.noPrint;
this.getField("Static2").display=display.noPrint;
}

 

1 reply

Bernd Alheit
Community Expert
Community Expert
June 5, 2024

Use read-only form fields for the text and you control it with a script.

Formbeginner
Known Participant
June 5, 2024

Vielen Dank für diesen Tipp! Wo könnte ich ein Beispiel-Script finden? Habe keinen blassen Schimmer von JavaScript.
Many thanks for this tip! Where could I find an example script? I don't know the first thing about JS.

PDF Automation Station
Community Expert
Community Expert
June 5, 2024

Field names:  "Entry" (the field the text will entered), "Static1", "Static2".

1)  Set the default values (in the options tab of the field properties) of Static1 and Static2 to the text that should be in them.

2)  Set them to Read Only (in the General tab) of the field properties.

3)  Enter the following custom validation script in the Entry field:

if(event.value)
{
this.getField("Static1").display=display.visible;
this.getField("Static2").display=display.visible;
}
else
{
this.getField("Static1").display=display.noPrint;
this.getField("Static2").display=display.noPrint;
}