Unusual rich text handling problem - InfoPath Dev
in

InfoPath Dev

Unusual rich text handling problem

Last post 07-30-2013 12:25 AM by Patrick Halstead. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 03-16-2010 02:28 AM

    Unusual rich text handling problem

    I've an Infopath for to be used via browser (IE)

    I've two rich text boxes, call them A and B, and a button.

    The button sets the InnerXml of B to a concatenation of the InnerXml of A and B, adding a divide between entries. This works and I think this is the correctly way to combine the contents of these two RT fields.

    My problem is this: After a user has filled A and pressed the button (that works fine), the cursor position remains in A. If the user then starts typing again the text appears in A but when they click the button this lastest text doesn't 'register' and doesn't make it into B. This problem occurs when the user can type in A without first clicking on A to select it. If a user clicks on A and then types then their text will be handled correctly. Here is the code from the 'on click' of the button:

    Dim AXpath As String = "/my:myFields/my:FormHistory/my:CommentBox"

    Dim BXpath As String = "/my:myFields/my:FormHistory/my:History"

     

    Dim A As XPathNavigator = MainDataSource.CreateNavigator().SelectSingleNode(AXpath, NamespaceManager)

    Dim B As XPathNavigator = MainDataSource.CreateNavigator().SelectSingleNode(BXpath, NamespaceManager)

    B.InnerXml = "<div xmlns=""http://www.w3.org/1999/xhtml"">" A.InnerXml & "</div>" & B.InnerXml

    Can anyone tell me why user text is lost and/or how to resolve this? Many thanks.

  • 07-25-2013 04:02 AM In reply to

    Re: Unusual rich text handling problem

    You're missing an '&' in the last line. And your spelling in this post is awful. Stop rushing and don't ask people to debug your code.

  • 07-30-2013 12:25 AM In reply to

    Re: Unusual rich text handling problem

    Hahahaha! :)

    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.