i found a super cool secret code to validate the whole form in one line of code!
F.execValidate();
so my print button is a normal button (not a print button)
with this code for onclick:
if(F.execValidate())
{
xfa.host.print(1, "0", (xfa.host.numPages - 1).toString(), 0, 1, 0, 0, 0);
}
easy as that!
IMPORTANT:
- unfortunatly it does not check if required fields are empty
- it only checks the "validation pattern" under Object > Value
- the "Error" box beside "validation pattern message" MUST be checked (if it is not checked, your validation errors will still popup, but the function will return true when it should be false - and therefore the print box will popup)