Copy link to clipboard
Copied
Hallo zusammen,
hätte mal eine Frage,
A =this.getField("Artikelnummer.0").value.toString;
if (A = "F.800.600") this.getField("Artikelbezeichung.0").value = "PM14/18 FFH 420-800/FFB 370-600",this.getField("Montagezeit.0").value=60, this.getField("Einzelpreis.0").value="103,83";
else if (A = "F.800.800") this.getField("Artikelbezeichung.0").value = "PM14/18 FFH 420-800/FFB 600-800",this.getField("Montagezeit.0").value=60, this.getField("Einzelpreis.0").value="116,73";
wenn ich dann in das Feld Artikelnummer.0 F.800.600 eingebe, werden die Felder nicht automatisch ausgefüllt. wo hab ich den Fehler gemacht?
mfg
Can you share the form?
Copy link to clipboard
Copied
The comparison operator of JS is " == ", not " = "...
Copy link to clipboard
Copied
Danke, aber das funktioniert auch nicht, z.B.: (A=="F.800.600")
Copy link to clipboard
Copied
Each getField command has to be separate. You can't separate them with a
comma in the same line of code.
Copy link to clipboard
Copied
You must use following:
if ( ) {
command;
command;
command;
} else if ( ) {
command;
command;
command;
}
Copy link to clipboard
Copied
Danke ich werde es gleich probieren
Copy link to clipboard
Copied
Dankeschön hat geholfen, aber jetz bekomme ich die Fehlermeldung:
TypeError: this.getField(...) is null
3:Field:Calculate
habe aber schon
A =this.getField("Artikelnummer.0").value.toString();
und
A =this.getField("Artikelnummer.0").valueAsString;
ausprobiert.
Copy link to clipboard
Copied
This happens when the field with this name doesn't exist.
Copy link to clipboard
Copied
But this Field Artikelnummer.0 exist.
Copy link to clipboard
Copied
What happens when you use "Artikelnummer" ?
Copy link to clipboard
Copied
Dann kommt im Debugger auch diese Meldung:
TypeError: this.getField(...) is null
3:Field:Calculate
Copy link to clipboard
Copied
The field name is incorrect, or the field itself is corrupt. Did you add it in Acrobat or in another application (like InDesign)?
Copy link to clipboard
Copied
Can you share the form?
Copy link to clipboard
Copied
wie kann ich mein PDF teilen, kann nur Bilder teilen?
Copy link to clipboard
Copied
Use Tools > Send & Track
and post the link
Copy link to clipboard
Copied
Or something like Dropbox or Google Drive...
Copy link to clipboard
Copied
http://www.truna.de/pdf/Schirrmacher Kalkulation.pdf
That's the whole Form.
Copy link to clipboard
Copied
- Move the code to be a custom validation script, instead of calculation.
- Replace:
this.getField("Artikelnummer.0").value.toString()
With:
event.value
- You have a mistake in the name of the "Artikelbezeichnung.0" field. You're referring it as "Artikelbezeichung.0" in your code (notice the missing "n" in "-nung"). German names are tricky when it comes to field names, nicht wahr? 🙂
Copy link to clipboard
Copied
Danke schön, sehr geholfen, hast was gut!
Copy link to clipboard
Copied
This line is also incorrect:
A = this.getField("Artikelnummer.0").value.toString;
toString is a function. To use it you must call it, like this:
this.getField("Artikelnummer.0").value.toString();
Or simply use:
this.getField("Artikelnummer.0").valueAsString;