Question about OnAftraChange - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Question about OnAftraChange

Last post 03-01-2005 09:23 AM by Greg Collins. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 02-27-2005 10:21 PM

    Question about OnAftraChange

    I have an InfoPath form that contain a field that contain OnAfterChange(DataDOMEvent e) event.
    In this event function i have this code (In C#):

    string str=e.Source.nodeValue.Tostring();
    this.thisXDocument.UI.Alert(str);

    I previewed the form and try this test: I enter in the field the input "test1" and get the alert "test1", I change the input from "test1" to "test2" and I get the Alert "test1" and after this the Alert "test2"!!!!

    Why I get again the alert "test1" after I changet it to "test2"????
    I want to get only alert about the current input!!!!
    How to do it???
  • 02-28-2005 02:27 PM In reply to

    Re: Question about OnAftraChange

    OnAfterChange has a property named "Operation". This event handler gets called twice (in most instances)... once to delete the old value, and once to insert the new value.

    You can add the following to the top of your event handler to only deal with Insert operations...
    if("Insert" != e.Operation)
    return;


    Greg Collins [InfoPath MVP]
  • 02-28-2005 11:20 PM In reply to

    Re: Question about OnAftraChange

    Thank you Greg. It's work!
  • 03-01-2005 09:23 AM In reply to

    Re: Question about OnAftraChange

    Awesome!

    Greg Collins [InfoPath MVP]
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.