I’m using self.close() in $$Return to automatically close the doc window when it is saved. I’d now also like to use showModalDialog as a save confirmation prompt prior to closing the window. This is what I have now:
“[” + “<script language="javascript">self.close()”
and this is what I tried:
“[” + “<script language="javascript">window.showModalDialog(”+DBPath+“/wfrmCloseEvent?OpenForm):self.close()”
(where dbpath is calc prior)
I get an error - “Missing :” What’s the proper syntax for multiple commands like this? - or how should I be doing this?
Subject: Change that “:” to a “;”
Subject: Need help with syntax for $$Return
Try:
“[” + “<script language="javascript">var win = window.showModalDialog(”+DBPath+“/wfrmCloseEvent?OpenForm);self.close()”
Dont know what context you are using this code but do you not need to close your square bracket? “]”
HTH
Subject: Thanx, guys, we’re getting closer…
I now have:
DBPath:=@ReplaceSubstring(@Subset(@DbName; -1); " " : “\”; “+” : “/”);
“[” + “<script language="javascript">window.showModalDialog(”/“”+DBPath+“/wfrmCloseEvent?OpenForm);self.close()” + “]”
and upon submit, the doc window now pulls up the view from which the doc came, rather than the wfrmCloseEvent form.
Subject: RE: Thanx, guys, we’re getting closer…
Try:
DBPath:=@ReplaceSubstring(@Subset(@DbName; -1);
“[” + “<script language="javascript">window.showModalDialog("/”+DBPath+“/wfrmCloseEvent?OpenForm");self.close()” + “]”
You got your Quotation marks all mixed up in the “[” + "<script … line. You didnt even close the quotes when your url ended. i.e after openForm.
Let me know how this goes.