Skip to main content
Formbeginner
Known Participant
Jun 5, 2024 12:46 PM UTC
Answered

Wenn Optionsfeld geklickt, soll Text erscheinen

Hallo liebe Community,

 

ich erstelle ein Formular direkt aus Acrobat Pro heraus.

 

Darin gibt es ein Optionsfeld mit zwei Auswahlmöglichkeiten "Auswahl1" und "Auswahl2".

Je nachdem, welche Auswahl aktiv ist, sollen mehrere Textfelder erscheinen. Soweit easy: Einfach unter den Eigenschaften entsprechende Aktionen hinzufügen.

 

Mir stellt sich nun die Frage, ob es die Möglichkeit gibt, die betreffenden Textfelder (es sind vieeeeele) irgendwie zu bündeln / in einen Container zu packen, um dem gesamten Container auf einmal anszusprechen. Im Adobe LiveCycle Designer ging das wunderbar mit sogenannten "Subforms".

Hat jemensch Ideen?

This topic is closed to new replies. Start a new post to keep the conversation going.
Nesa Nurani
Nesa NuraniCorrect answer
Community Expert
Jun 5, 2024 1:20 PM UTC

You can put all the fields names in an array, and use script as custom calculation script of any text field, something like this:

var fields = ["Text1", "Text2", "Text3"];//put all the fields names in this array
var rb = this.getField("Group1").valueAsString;

for(var i=0; i<fields.length; i++){
var f = this.getField(fields[i]);
if(rb == "Selection1")
f.display = display.visible;
else
f.display = display.hidden;}

2 replies

Nesa Nurani
Community Expert
Nesa NuraniCommunity ExpertCorrect answer
Community Expert
Jun 5, 2024 1:20 PM UTC

You can put all the fields names in an array, and use script as custom calculation script of any text field, something like this:

var fields = ["Text1", "Text2", "Text3"];//put all the fields names in this array
var rb = this.getField("Group1").valueAsString;

for(var i=0; i<fields.length; i++){
var f = this.getField(fields[i]);
if(rb == "Selection1")
f.display = display.visible;
else
f.display = display.hidden;}
Translate
Formbeginner
Known Participant
Jun 11, 2024 8:43 AM UTC

Dear Nesa Nuraini,

thank you very much, very elegantly solved!
And I even managed it 🙂

Translate