buttons rules and text boxes - NEED URGENT - InfoPath Dev
in

InfoPath Dev

buttons rules and text boxes - NEED URGENT

Last post 07-18-2005 11:21 AM by Greg Collins. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 07-18-2005 07:40 AM

    • buzzby
    • Top 200 Contributor
    • Joined on 07-11-2005
    • United Kingdom
    • Posts 60

    buttons rules and text boxes - NEED URGENT

    hi

    First of all how can i set the value of a textbox that is formatted as a number field as i cannot get it to work.

    XDocument.DOM.selectSingleNode("/my:myFields/my:flag") = 1;
    and
    XDocument.DOM.selectSingleNode("/my:myFields/my:flag").Text = "1";

    do not work.


    Also i have some rules setup on some buttons but i only want those rules to run if an IF statment with the code of the button is true.

    How can i run rules through JScript.

    Thanks
  • 07-18-2005 11:21 AM In reply to

    Re: buttons rules and text boxes - NEED URGENT

    The first approach is invalid code. The second approach is the correct one:

    XDocument.DOM.selectSingleNode("/my:myFields/my:flag").Text = "1";

    What is the error you are getting?

    Are you attempting to do this in an OnBeforeChange or OnValidate event handler? The DOM is readonly during those events and you will not be able to update values.

    You cannot run rules from code. This is not supported. However, you can call into code from the rule condition and have your code return true or false to decide whether to run the rule. To do this, see my article "Use Code to Determine a Rule Condition":http://www.infopathdev.com/howto/tutorials/default.aspx?i=88f921f13dec4e7cae61191bac084fff


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