Copy link to clipboard
Copied
Ich habe ein Formular mit den Textfeldern für Wochentage Montag - Sonntag. Ich möchte die Felder zählen, in den ich einen Zahlwert eingetragen habe um zu ermitteln, ob ich eine 5 oder 6 Tage Woche erhalte. Hat jemand eine Idee?
Copy link to clipboard
Copied
So you want to count how many fields in a group are filled in, basically? What are the names of those fields?
Copy link to clipboard
Copied
Mo Di Mi Do Fr Sa So
Copy link to clipboard
Copied
OK, then you can use this script as the custom calculation script of a text field to show how many fields in the group have a value:
var fields = ["Mo", "Di", "Mi", "Do", "Fr", "Sa", "So"];
var cnt = 0;
for (var i in fields) {
var f = this.getField(fields[i]);
if (f.valueAsString!="") cnt++;
}
event.value = cnt;