red border for empty required fields only
Hi
i’m creating a form with required fields and checkboxes. A warning shows up, in case some fields were left empty.
Everything worked fine so far by adding this already posted code to the "submit button“:
for (var i=0; i<this.numFields; i++) {
var f = this.getField(this.getNthFieldName(i));
if (f!=null && f.type!="button" && f.required && f.valueAsString==f.defaultValue) {
emptyFields.push(f.name);
}
}
if (emptyFields.length>0) {
app.alert("Bitte füllen Sie die leeren Felder aus:\n" + emptyFields.join("\n"));
} else this.mailDoc({cTo: „my@email.ch"});
now i’d like to show the user with a red border, which required fields are still empty, in case the user missed one or more.
In addition, is it possible to let the red border hide, while inserting text?
many thanks for your help
reto
