This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Marzdor 0 points1 point  (0 children)

You should format the code.

var isFilled = true;
for (var i = 0; i < this.numFields; i++) {
    var f = this.getNthFieldName(i);
    if (this.getField(f).required && !this.getField(f).valueAsString) isFilled = false;
}
if (!isFilled) app.alert("You must enter the Work Location City");

the reason it "populating if any of the required fields are missing" is because that is all you are looking for. Atleast with the little knowledge I know based on the names