Participant
Oct 9, 2025 12:04 PM UTC
Answered
Field shows zero instead of nothing
- 4 replies
- 237 views
- Translate
Earlier this year i created a form with some simple calculations and some fields with java script. User have the choice to fill it in by hand (print and pencil) or use the form online or offline.
Last week i noticed that the form shows the calculation fields and the Java Script based fields show a zero. And this zero is also printed when a user wanted to fill it in manualy.
var getal1 = this.getField("veld1").value;
var getal2 = this.getField("veld2").value;
if (!isNaN(getal1) && !isNaN(getal2)) {
event.value = Number(getal1) - Number(getal2);
} else {
event.value = "";
}

Who has a solution,
Best,
Ton
