I have a form with a checkbox that, when checked, displays an error message using Javascript xfa.hostmessage on the click event. I would like the form to close after the user clicks "OK" on the Javascript Warning box.
I have tried adding an app.execMenuItem(Close); script after the xfa.hostmessage box script, but it did not work. I also tried the app.execMenuItem(Close); script on the exit event of the checkbox, to no avail.
Is this even possible? Any assistance is greatly appreciated.
Solved! Go to Solution.
Hi,
the massageBox method has a return value, you can use to determin, if the user has clicked OK or not.
if (xfa.host.messageBox("Close Doc?", "Close Doc", "2", "1") === 1) {
event.target.closeDoc(false);
}
Hi,
the massageBox method has a return value, you can use to determin, if the user has clicked OK or not.
if (xfa.host.messageBox("Close Doc?", "Close Doc", "2", "1") === 1) {
event.target.closeDoc(false);
}
Thanks radzmar! Works like a charm.
To clarify for everyone else, radzmar's script, when added to the click event after an xfa.host.messageBox, opens a second dialog box when the user clicks 'OK'. The second dialog box asks if the user wants to close the document and allows for 'OK' or 'Cancel' to be selected.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies