SendEmail when check box changes state using script.js - InfoPath Dev
in

InfoPath Dev

SendEmail when check box changes state using script.js

Last post 09-21-2015 09:22 AM by diskovered. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 09-21-2015 09:22 AM

    SendEmail when check box changes state using script.js

    I'm trying to modify this function and was hoping to get some help from the community. How do add a code so when a field state changes, in this case, if a field is checked/selected, it would send me an email alert via my smarthost / smtp server. I tried using Rules and having my email address as the Data Connection but that didn't work as there is no Outlook installed (installing is not an option)

    //=======
    // The following function handler is created by Microsoft Office InfoPath.
    // Do not modify the name of the function, or the name and number of arguments.
    //=======
    function SaveSubmit::OnClick(eventObj)
    {
    if(!CheckCommentsLength())
    {
    return;
    }

    if (! FieldName()) {
    return;
    }

    if (SaveForm()) { // if worked to save then
    var formid = XDocument.DOM.selectSingleNode

    (g_datarootelement + "/my:FieldName1").text;
    var version = XDocument.DOM.selectSingleNode

    (g_datarootelement + "/my:FieldName2").text;
    var usertoken = XDocument.DOM.selectSingleNode

    (g_datarootelement + "/my:FieldName3").text;

    UnlockForm(form1, form2, form3);
    }

    ForceClose();
    }
    Filed under: ,
Page 1 of 1 (1 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.