<?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: Inserting a row by clicking a check box</title><link>https://www.infopathdev.com:443/forums/thread/57046.aspx</link><pubDate>Sat, 17 Jul 2010 12:50:47 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:57046</guid><dc:creator>Skarn</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/57046.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=57046</wfw:commentRss><description>&lt;p&gt;Example&amp;nbsp;using jScript - Repeating&amp;nbsp;group is called &amp;#39;rGroup&amp;#39;&amp;nbsp;&lt;br /&gt;=========================================&lt;/p&gt;
&lt;p&gt;On the &amp;#39;After Validate&amp;#39; event of a&amp;nbsp;&amp;#39;check box&amp;#39; field named &amp;#39;fCheck&amp;#39;&amp;nbsp;contained in rGroup with a checked value of 1 and unchecked value of -1&lt;/p&gt;
&lt;p&gt;if(eventObj.Source.selectSingleNode(&amp;quot;.&amp;quot;).text ==&amp;#39;1&amp;#39;)&lt;br /&gt;{&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;var nodeParent = eventObj.Source.selectSingleNode(&amp;quot;../..&amp;quot;);&lt;br /&gt;var nodeNextSibling = eventObj.Source.selectSingleNode(&amp;quot;..&amp;quot;).nextSibling;&lt;/p&gt;&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;nbsp;//Get a reference to the sampledata DOM.&lt;br /&gt;&amp;nbsp;var objSampleDataDOM = XDocument.DOM;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;//Create a new DOMDocument, and load the template into it.&lt;br /&gt;&amp;nbsp;var objTemplateDoc = XDocument.CreateDOM();&lt;br /&gt;&amp;nbsp;objTemplateDoc.validateOnParse = false;&lt;br /&gt;&amp;nbsp;objTemplateDoc.load(&amp;quot;template.xml&amp;quot;);&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;//Set the SelectionNamespaces to the same value as the main DOM.&lt;br /&gt;&amp;nbsp;var strSelectionNamespaces = objSampleDataDOM.getProperty(&amp;quot;SelectionNamespaces&amp;quot;);&lt;br /&gt;&amp;nbsp;objTemplateDoc.setProperty(&amp;quot;SelectionNamespaces&amp;quot;, strSelectionNamespaces );&lt;br /&gt;&lt;br /&gt;//Clone the repeating group from the &amp;#39;template&amp;#39; DOM&lt;br /&gt;&amp;nbsp;var nodeClone = objTemplateDoc.selectSingleNode(&amp;quot;//my:rGroup&amp;quot;).cloneNode(true);&lt;br /&gt;&lt;br /&gt;//Insert the new&amp;nbsp;node (if nodeNextSibling is&amp;nbsp;null then it will append)&lt;br /&gt;&amp;nbsp;var nodeNew = nodeParent.insertBefore(nodeClone,nodeNextSibling);&amp;nbsp;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;You probably want to reset the checkbox after the insert occurs?&lt;/p&gt;
&lt;p&gt;Just add eventObj.Source.selectSingleNode(&amp;quot;.&amp;quot;).text = &amp;#39;-1&amp;#39; to the code.&lt;/p&gt;</description></item><item><title>Inserting a row by clicking a check box</title><link>https://www.infopathdev.com:443/forums/thread/57018.aspx</link><pubDate>Fri, 16 Jul 2010 15:03:20 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:57018</guid><dc:creator>MikeJL</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/57018.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=57018</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am currently using InfoPath 2010 and have created a repeating table with a few text boxes and a single check box.&amp;nbsp; When i click the check box i want to insert a row after (a function usually executed&amp;nbsp;through the keystrokes: ctrl+enter).&amp;nbsp; I have already tried the ideas suggested here: &lt;a href="http://www.bizsupportonline.net/infopath2007/4-way-programmatically-add-row-repeating-table.htm"&gt;http://www.bizsupportonline.net/infopath2007/4-way-programmatically-add-row-repeating-table.htm&lt;/a&gt;&amp;nbsp;however, I continue to get an error message&amp;nbsp;saying &amp;quot;schema validation found non-datatype errors.&amp;quot;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Your help would be&amp;nbsp;appreciated. Thank you.&lt;/p&gt;</description></item></channel></rss>