Hi, I have a submit button that validates before submitting the data. When I enter data into the field and click on the submit button, it alerts with the message and refocuses on the field. If I press submit again, it checks fine. Why does it not check fine the first time? I added this.getField("Submit").setFocus() to the submit function to see if that'll fix the problem, no go. I read somewhere to use xfa.host.messageBox() but I'm not using xfa and don't really plan to. Any ideas?
if(!CheckField("firstname","First name is mandatory")) {return;}
function CheckField(name,message){
var f = getField(name);
if(f.value == ""){
app.alert(message);
f.setFocus();
return false;
}
return true;
}
George Kaiser