<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: IP 2003 Java-script: How to add HTML tags to Rich Text box</title><link>https://www.infopathdev.com:443/forums/thread/41456.aspx</link><pubDate>Fri, 08 May 2009 21:00:33 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:41456</guid><dc:creator>aesalazar</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/41456.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=41456</wfw:commentRss><description>&lt;p&gt;Havent figure this out yet but figure what I would post what I have so that others might get at least a little benefit.&lt;/p&gt;&lt;p&gt;It seems that a rich text box is a collection of HTML tags broken out in separate nodes within the namespace of the rich text box. &amp;nbsp; I have been able to clone HTML tags and text that are ALREADY in the rich text box by doing something like this:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pn = XDocument.DOM.selectSingleNode(&amp;quot;//dfs:myFields/my:Reporting/my:Summary_Methods&amp;quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pn.appendNode(pn.childNodes[0].cloneNode(true))&lt;/p&gt;&lt;p&gt;In this case, childnode 0 might be something like a bolded word followed by plain text that I typed manually in the IP form.&amp;nbsp; Problem is I can copy a node but can only change its text and not the HTML tags that surround it.&amp;nbsp; I was able to create a node from scratch with this:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; xNode= XDocument.DOM.createNode(1, &amp;quot;strong&amp;quot;,&amp;quot;http://www.w3.org/1999/xhtm&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; xNode.text = &amp;quot;X&amp;quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp;which ended up being a bolded &amp;quot;X&amp;quot; according to:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp; xNode.xml: &amp;quot;&amp;lt;strong xmlns=&amp;quot;http://www.w3.org/1999/xhtm&amp;quot;&amp;gt;X&amp;lt;/strong&amp;gt;&amp;quot; &lt;br /&gt;&lt;/p&gt;&lt;p&gt;Great, I thought I had it until I realized I canNOT do an appendChild to stick xNode in pn as a child.&amp;nbsp; It gives me an error saying that it is not in the expect format.&amp;nbsp; Basically xNode is setting in limbo not really assigned to anything in the tree.&lt;/p&gt;&lt;p&gt;So does anyone know of a way to use the createNode method at the node where I need to add xNode?&amp;nbsp; I cant simply do:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; xNode = XDocument.DOM.selectSingleNode(&amp;quot;//dfs:myFields/my:Reporting/my:Summary_Methods&amp;quot;) .createNode(1, &amp;quot;strong&amp;quot;,&amp;quot;http://www.w3.org/1999/xhtm&amp;quot;);&lt;br /&gt;&lt;/p&gt;&lt;p&gt;since the method is not support at that level.&lt;/p&gt;&lt;p&gt;&amp;nbsp;I am about ready to give up but if anyone else knows of a way, please let me know.&amp;nbsp; I cant believe it is this hard.&lt;/p&gt;&lt;p&gt;Thanks&lt;/p&gt;&lt;p&gt;Ernie &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>IP 2003 Java-script: How to add HTML tags to Rich Text box</title><link>https://www.infopathdev.com:443/forums/thread/41417.aspx</link><pubDate>Fri, 08 May 2009 00:36:03 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:41417</guid><dc:creator>aesalazar</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/41417.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=41417</wfw:commentRss><description>&lt;p&gt;Hi guys.&amp;nbsp; I am kind of stuck here.&amp;nbsp; I want to be able to work with the contents of an IP Rich Text box and add formatted content (bold, underline, carriage returns, etc.).&amp;nbsp; I assume I will have to add the HTML tags some how but I havent had much luck doing it.&amp;nbsp; Doing a straight .selectSingleNode.text = &amp;quot;xxx&amp;quot; only results in the HTML code showing up as plain text.&amp;nbsp; I tried replacing the .xml content of the node but get an error saying the the wrong number of parameters were passed.&lt;/p&gt;&lt;p&gt;&amp;nbsp;I have turned up how-to&amp;#39;s when doing it in .net but nothing from within IP itself using plain old javascript.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;Thanks for any help&lt;/p&gt;&lt;p&gt;&amp;nbsp;Ernie &lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>