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

Acrobar Feldberechnung

New Here ,
Nov 15, 2022 Nov 15, 2022

Copy link to clipboard

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

Translate

Translate

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 guidelines

correct answers 1 Correct answer

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;

Votes

Translate

Translate
Community Expert ,
Nov 17, 2022 Nov 17, 2022

Copy link to clipboard

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;

Votes

Translate

Translate

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 guidelines
New Here ,
Nov 21, 2022 Nov 21, 2022

Copy link to clipboard

Copied

DANKE - Hallo, erhalte diese Fehlermeldung:

 

SyntaxError: missing ; before statement
7:Field:Calculate

Votes

Translate

Translate

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 guidelines
Community Expert ,
Nov 21, 2022 Nov 21, 2022

Copy link to clipboard

Copied

What script does you use?

Votes

Translate

Translate

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 guidelines
New Here ,
Nov 21, 2022 Nov 21, 2022

Copy link to clipboard

Copied

Hello, I made a screenshot

Votes

Translate

Translate

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 guidelines
Community Expert ,
Nov 21, 2022 Nov 21, 2022

Copy link to clipboard

Copied

LATEST

Put the script at "Benutzerdef. Berechnungsskript"

Votes

Translate

Translate

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 guidelines