submit form using onbeforechange event - InfoPath Dev
in

InfoPath Dev

submit form using onbeforechange event

Last post 11-06-2005 09:45 PM by Patrick Halstead. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 11-06-2005 05:48 PM

    submit form using onbeforechange event

    Hi,

    I have a check box which when the user unchecks. It will set its value to false and then submit this to Access. however,it is not allowing me submit the form due to "Form cannot be submited: Form does not contain any new data"

    Code is as follows:
    function msoxd__Activity_Status_attr::OnBeforeChange(eventObj)
    {
    try {
    if (eventObj.NewValue != eventObj.OldValue){
    var resp = XDocument.UI.Confirm("Are you sure you want to delete this record?", 4);
    if (resp != 6 ) {
    eventObj.ReturnStatus = false;
    }else{
    XDocument.Submit();
    eventObj.ReturnStatus = true;
    }
    }
    } catch (e) {}
    }
  • 11-06-2005 09:45 PM In reply to

    Re: submit form using onbeforechange event

    Hi AbsMing,
    You can't do Submit in the OnBeforeChange handler since the XML has not yet been updated with the value. Try moving it to the OnAfterChange handler.

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.