Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Acrobar Feldberechnung

New Here ,
Nov 15, 2022 Nov 15, 2022

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
1.8K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
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;

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
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;
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 21, 2022 Nov 21, 2022

DANKE - Hallo, erhalte diese Fehlermeldung:

 

SyntaxError: missing ; before statement
7:Field:Calculate

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

What script does you use?

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

Hello, I made a screenshot

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

Put the script at "Benutzerdef. Berechnungsskript"

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