Help: Type Mismatch - InfoPath Dev
in

InfoPath Dev

Help: Type Mismatch

Last post 10-04-2010 11:44 AM by Hilary Stoupa. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 10-04-2010 10:02 AM

    Help: Type Mismatch

    Hello, 

     I am trying to have a JavaScript Alert box popup when a user clicks a button.  Contained in the description of the popup box would be whatever was written in a textbox (field7).  Field 7 is a string, however I get type mismatch with the following code:

    XDocument.DOM.setProperty("SelectionNamespaces", 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2010-09-29T18:34:12" xmlns:xd="http://schemas.microsoft.com/office/infopath/2003"');  

    function CTRL16_5::OnClick(eventObj)

     {

     var field7 = XDocument.DOM.selectSingleNode("my:Main/my:myFields/my:field7");

    XDocument.UI.Alert(field7);      //This is the line that causes the type mismatch error

    }

     

     

    Programming Language:  JavaScript

    Application:  Microsoft Office InfoPath 2003 SP3

  • 10-04-2010 11:44 AM In reply to

    Hi -- you are selecting the node. I think your line with the error should be something along the lines of:

    XDocument.UI.Alert(field7.text);     

    Hilary Stoupa

Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.