• Global community
• Language:
• Deutsch
• English
• EspaÃ±ol
• FranÃ§ais
• PortuguÃªs
• æ—¥æœ¬èªžã‚³ãƒŸãƒ¥ãƒ‹ãƒ†ã‚£
Dedicated community for Japanese speakers
• í•œêµ­ ì»¤ë®¤ë‹ˆí‹°
Dedicated community for Korean speakers
Exit
• Betreff: Acrobar Feldberechnung

# Acrobar Feldberechnung

New Here ,
Nov 15, 2022 Nov 15, 2022

Copied

Bin der abolute AnfÃ¤nger in bezgl. der Berechnung von Formularfeldern mit Java. Mein Problem: Ich habe ein eingabefeld "Distance" (Entfernung). Ja nach Entfernung < 300 (2,67) oder > 300 (1,50) muss ein anderer Wert gewÃ¤hlt werden. Ich habe folgende Formel in die Berechnung geschrieben: if(Distance<300,"2.67","1.50"). Dann kommt immer Fehler ")" fehlt, aber ich bekomme es nicht zum laufen - wer kann mir helfen? Danke & GruÃŸ

TOPICS
JavaScript

Views

1.6K

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Community Expert , Nov 17, 2022 Nov 17, 2022

Use this:

``````var dist = Number(this.getField("Distance").valueAsString);
if (dist == 0)
event.value = "";
else if (dist < 300)
event.value = 2.67;
else
event.value = 1.50;``````

5 Replies 5
Community Expert ,
Nov 17, 2022 Nov 17, 2022

Copied

Use this:

``````var dist = Number(this.getField("Distance").valueAsString);
if (dist == 0)
event.value = "";
else if (dist < 300)
event.value = 2.67;
else
event.value = 1.50;``````

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
Nov 21, 2022 Nov 21, 2022

Copied

DANKE - Hallo, erhalte diese Fehlermeldung:

SyntaxError: missing ; before statement
7:Field:Calculate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Community Expert ,
Nov 21, 2022 Nov 21, 2022

Copied

What script does you use?

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
Nov 21, 2022 Nov 21, 2022

Copied

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Community Expert ,
Nov 21, 2022 Nov 21, 2022

Copied

LATEST

Put the script at "Benutzerdef. Berechnungsskript"