javascript if statement

Avatar

Avatar

herveys81193086

Avatar

herveys81193086

herveys81193086

25-06-2015

Hello,

I am not good at javascript so I got this button "Save as..." and a javascript messagebox comes up asking if they secure the document before save it:

xfa.host.messageBox("WARNING", "Did you secure the document prior saving it?", 3, 2);

If they say 3 (yes), the javascript code should be apply: app.execMenuItem("SaveAs");

If 2 (no), go back to the document. Anyone can help?

Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

jasotastic81

Avatar

jasotastic81

jasotastic81

29-06-2015

OK, here's working script.

btnSaveAs::click

if (xfa.host.messageBox("Did you secure the document prior to saving it?", "WARNING",2,2) == 4) app.execMenuItem("SaveAs");

Answers (2)

Answers (2)

Avatar

Avatar

herveys81193086

Avatar

herveys81193086

herveys81193086

29-06-2015

Still gives me the option to save as if I click option 2.

Avatar

Avatar

jasotastic81

Avatar

jasotastic81

jasotastic81

25-06-2015

Something like this, probably:


if (xfa.host.messageBox("WARNING","Did you secure the document prior to saving it?",3,2) == 3) app.execMenuItem("SaveAs");