Scripting Promt to save - InfoPath Dev
in

InfoPath Dev

Scripting Promt to save

Last post 03-27-2007 10:30 AM by skrile. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 03-27-2007 07:57 AM

    • skrile
    • Top 500 Contributor
    • Joined on 08-17-2006
    • USA
    • Posts 29

    Scripting Promt to save

    I know I can assign a rule to a button called "Close this form: Prompt" that will prompt the user to save the form if it's "dirty" and then closes the window. My question is, can I do the same thing from jscript. I don't have a managed code solution.

    The issue here is I want to build emails when the Save button is clicked so I would like to execute a bunch of other script, but if I use the Close this Form rule, nothing get's executed in my button's OnClick event.
  • 03-27-2007 08:36 AM In reply to

    • skrile
    • Top 500 Contributor
    • Joined on 08-17-2006
    • USA
    • Posts 29

    Re: Scripting Promt to save

    And the answer is....


    var oXmlHttp = new ActiveXObject("MSXML2.XMLHTTP");
    oXmlHttp.Open("PUT", XDocument.URI, false);  
    oXmlHttp.Send(XDocument.DOM.xml);


    This of course only works when you are opening an existing form, but it works very nicely. Now, to get the window to close....hmmmmm
  • 03-27-2007 10:30 AM In reply to

    • skrile
    • Top 500 Contributor
    • Joined on 08-17-2006
    • USA
    • Posts 29

    Re: Scripting Promt to save

    And even cleaner (with window closing too!!!)


    Application.ActiveWindow.Close(false);
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.