Problem in OnAfterCahnge event - InfoPath Dev
in

InfoPath Dev

Problem in OnAfterCahnge event

Last post 02-16-2006 05:24 AM by vt_asparagus. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 02-14-2006 10:50 PM

    Problem in OnAfterCahnge event

    I Have a text box and I write this code in the OnBeforeChange Event:

    If eventObj.IsUndoRedo Then
    Exit Sub
    end if

    If eventObj.Operation="Delete" Then
    Exit Sub
    end if

    dim str1

    str1=eventObj.NewValue

    if len(str1)<4 then
    eventObj.ReturnStatus=false
    eventObj.ReturnMessage="should be more than 4"
    end if

    That code work. But when I write the same code in the OnAfterChange Event I dont get the ReturnMessage. I get it only if I change it to:

    XDocument.UI.Alert("should be more than 4")

    Why it's happen???
  • 02-16-2006 05:24 AM In reply to

    Re: Problem in OnAfterCahnge event

    Becuase the return message is in OnBeforeChange to send a user a message if you are not going to allow the change to continue. In the case of OnAfterChange, the change has been committed to the DOM.
    Jason
    http://www.k2distillery.com/
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.