Obtaining the value of controls - InfoPath Dev
in

InfoPath Dev

Obtaining the value of controls

Last post 11-07-2006 03:53 PM by Greg Collins. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 11-07-2006 06:10 AM

    • Jackie
    • Not Ranked
    • Joined on 11-07-2006
    • Posts 1

    Obtaining the value of controls

    Can anyone help? I have put in place a control that forces the user to click on a checkbox. Depending on the value with depend on the view the user sees. The code is below:

    var strValue
    strValue = XDocument.DOM.selectSingleNode"//my:Change/my:ChangeSubmit").text

    XDocument.UI.Alert(strValue)

    if (strValue.text = "false")
    XDocument.ViewInfos("Main View").IsDefault = true;

    if (strValue.text = "true")
    XDocument.ViewInfos("TUG View").IsDefault = true;

    The value (strValue) is correct and is giving me a true or false text value via the alert. The problem I am having is that the "If" statement is not recognising the value therefore the line of code that changes the view does not run.

    Any suggestions greatly appreciated.

    Many thanks
    Jackie
  • 11-07-2006 03:53 PM In reply to

    Re: Obtaining the value of controls

    First, the if statements should read: if(strValue == "false"), etc.

    Note that you are assigning the value "false" (single equal sign) instead of comparing (double equal sign).

    Second, strValue is the .text value already and that property probably doesn't even exist on the variable.

    Since this code is not running in the OnLoad event handler, you should not be using the .IsDefault property. Instead you should use the SwitchViews() function.
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.