Skip to main content
Participant
August 17, 2023
Answered

JavaSript - Mit Auswahl eines Kontrollkästchens eine Aktion verknüpfen

  • August 17, 2023
  • 2 replies
  • 1058 views

Hallo liebes Forum,

ich arbeite mit Adobe Acrobat Pro DC und hätte gerne Hilfe bei einem Problem.

Ich habe fünf Kontrollkästchen mit verschiedenen Beträgen (EUR) in meinem Formular und hätte gerne, dass mit Auswahl eines dieser Kontrollkästchen der jeweilige Betrag automatisch in ein anderes Textfeld übertragen wird. 

Bin für jede Hilfe dankbar.

This topic has been closed for replies.
Correct answer Nesa Nurani

If you set (EUR) as checkbox export value, go to text field properties and under 'Calculate' tab, select 'Value is the' and pick your checkboxes.

2 replies

try67
Community Expert
Community Expert
August 17, 2023

Set the amount as the export values of each box, and then as the custom calculation script of the text field use this (let's say the check-boxes group is called "Amount1"):

 

var amount = this.getField("Amount1").valueAsString;

if (amount=="Off") event.value = "";

else event.value = amount;

Participant
August 17, 2023

Auch dir, danke für die Antwort.

Nesa Nurani
Community Expert
Nesa NuraniCommunity ExpertCorrect answer
Community Expert
August 17, 2023

If you set (EUR) as checkbox export value, go to text field properties and under 'Calculate' tab, select 'Value is the' and pick your checkboxes.

Participant
August 17, 2023

Super, es hat geklappt! Vielen lieben Dank für die schnelle Antwort