Avatar

Level 6

I guess timed message is on the wish list

However in all my forms I use following scenario to validate all data entry at one time and then submit...

I use regular button and add code in Click event

JS example.....

var errorFlag = 0;

var errorMsg = "";

if (validation expression 1) {

     //true/pass

     //no need to change following values

     errorFlag = errorFlag;

     errorMsg = errorMsg;

}else {

    //false/fail

   //set the flag and message accordingly

    errorFlag = errorFlag + 1;

    errorMsg = errorMsg + "validation message1" + "\n"; //\n for new line with in the message

}

if (validation expression 2) {

     //true/pass

     //no need to change following values

     errorFlag = errorFlag;

     errorMsg = errorMsg;

}else {

    //false/fail

   //set the flag and message accordingly

    errorFlag = errorFlag + 1;

    errorMsg = errorMsg + "validation message2" + "\n"; //\n for new line with in the message

}

............

..............

..........

//finally

if (errorFlag > 0) {

    //>0 indicates there are one or more errors

    xfa.host.message(""+errorMsg);//display all messages at one time

    exit; //now since there are validation errors you can stop processing further and exit the event

}

//add submit code......here....