Expand my Community achievements bar.

Printing Problem

Avatar

Former Community Member
Can someone tell me how to fix my problem? See the code below. I have a form that gets filled out by the user. When the print/submit button is pushed this code executes. I want two copies of the form to print. When I have the printer dialog box turned off, the form prints with the data. When I turn on the printer dialog box, the script seems to go ahead and execute all the way thru and by the time the form prints, the fields have already been reset and does not show up on the form. Turn off the dialog box and the data prints. Seems I need some type of hold?? Is there a simple fix?



Thanks,



Stan



----- form1.form2.PrintButton1::click: - (JavaScript, client) --------------------------------------



xfa.host.messageBox("Make sure that the printer has legal paper loaded.\n The printer will print two copies, a control room copy and the field copy.\n Complete the permit by printing and signing in the appropriate places.","PRINT & SIGN PERMIT",1,0);

CopyField.rawValue=("Control Room Copy");

CopyField.presence="visible";

xfa.layout.relayout();

xfa.host.print(1, "0", (xfa.host.numPages -1).toString(), 0, 1, 1, 0, 0);

CopyField.rawValue=("Field Copy");

CopyField.presence="visible";

TextField11.presence="visible";

TextField12.presence="visible";

xfa.layout.relayout();

xfa.host.print(1, "0", (xfa.host.numPages -1).toString(), 0, 1, 0, 0, 0);

LOTO_Subform.presence="invisible";

HW_Subform.presence="invisible";

BIP_Subform="invisible";

StaticText9.presence="visible";

StaticText10.presence="visible";

StaticText11.presence="visible";

xfa.host.resetData();
0 Replies