<?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: OnClick code only running for first instance of repeating section</title><link>https://www.infopathdev.com:443/forums/thread/42263.aspx</link><pubDate>Fri, 29 May 2009 15:12:04 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:42263</guid><dc:creator>kminor</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/42263.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=42263</wfw:commentRss><description>&lt;p&gt;Hilary, I used your script as a starting point, and my form is finally doing what I need it to do!&lt;/p&gt;
&lt;p&gt;In case anyone else might have the same issue down the road, here is an example of the syntax I used within the &amp;quot;For... Next&amp;quot; loop to access the individual text boxes in the repeating section:&lt;/p&gt;
&lt;p&gt;Set shipToNum = node.selectSingleNode(&amp;quot;@ShipToNum&amp;quot;)&lt;/p&gt;
&lt;p&gt;Remember that &amp;quot;node&amp;quot; was set in Hilary&amp;#39;s script.&lt;/p&gt;
&lt;p&gt;Thanks again -- you&amp;#39;ve been a huge help.&amp;nbsp; Hope you have a great day!&lt;/p&gt;</description></item><item><title>Re: OnClick code only running for first instance of repeating section</title><link>https://www.infopathdev.com:443/forums/thread/42206.aspx</link><pubDate>Thu, 28 May 2009 13:07:02 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:42206</guid><dc:creator>kminor</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/42206.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=42206</wfw:commentRss><description>Hilary -- thank you SO much!&amp;nbsp; I apologize for taking so long to get back to you on this; I&amp;#39;ve been eyeball-deep in a couple of other projects, too.&amp;nbsp; I hate being in that newbie stage of learning new technology because I know what needs to happen in code; I just can&amp;#39;t figure out the syntax!&amp;nbsp; :)</description></item><item><title>Re: OnClick code only running for first instance of repeating section</title><link>https://www.infopathdev.com:443/forums/thread/41908.aspx</link><pubDate>Wed, 20 May 2009 22:56:02 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:41908</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/41908.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=41908</wfw:commentRss><description>&lt;p&gt;Hi, so you are using vbscript?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Dim objXMLNodes &lt;br /&gt;Set objXMLNodes = XDocument.DOM.selectNodes(&amp;quot;/my:myFields/my:group/my:repeatinggroup&amp;quot;) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for each node in objXMLNodes &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XDocument.UI.Alert(node.nodeName + VBNewLine + node.text) &lt;br /&gt;&amp;nbsp; next&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;I&amp;#39;m attaching my sample form. In the header of this reply, right click the link and use Save As to save locally. Right click the saved form and open in design mode. Preview and click the button....&lt;/p&gt;</description></item><item><title>Re: OnClick code only running for first instance of repeating section</title><link>https://www.infopathdev.com:443/forums/thread/41868.aspx</link><pubDate>Tue, 19 May 2009 14:33:55 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:41868</guid><dc:creator>kminor</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/41868.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=41868</wfw:commentRss><description>&lt;p&gt;I hate to be a pest, but I still haven&amp;#39;t figured this out.&amp;nbsp; Can anyone help, please?&lt;/p&gt;</description></item><item><title>Re: OnClick code only running for first instance of repeating section</title><link>https://www.infopathdev.com:443/forums/thread/41766.aspx</link><pubDate>Fri, 15 May 2009 14:27:45 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:41766</guid><dc:creator>kminor</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/41766.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=41766</wfw:commentRss><description>&lt;p&gt;Still looking for help on this, if anyone has any to offer.&amp;nbsp; Please, and thank you!&amp;nbsp; :)&lt;/p&gt;</description></item><item><title>OnClick code only running for first instance of repeating section</title><link>https://www.infopathdev.com:443/forums/thread/41666.aspx</link><pubDate>Wed, 13 May 2009 16:33:25 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:41666</guid><dc:creator>kminor</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/41666.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=41666</wfw:commentRss><description>&lt;p&gt;Hello, I am stumped and could use some help.&amp;nbsp; I began researching an answer (both here and on the web) yesterday, and I&amp;#39;m still not even close, I&amp;#39;m afraid.&lt;/p&gt;
&lt;p&gt;I&amp;nbsp;created a form in InfoPath 2003 that uses a repeating section to enter customer data.&amp;nbsp; It has a button at the bottom of the page.&amp;nbsp; I&amp;#39;ve written some validation code that runs in&amp;nbsp;the on-click event of&amp;nbsp;the button.&lt;/p&gt;
&lt;p&gt;The problem I&amp;#39;m having is that when the code in the on-click event runs, it only looks at the first instance of the repeating section.&amp;nbsp; I&amp;#39;m trying to figure out how to loop through all the instances of the repeating section to have the validation code check each instance.&amp;nbsp; I believe I need to use SelectNodes, but I can&amp;#39;t figure out where to go with it.&lt;/p&gt;
&lt;p&gt;My data structure looks like:&lt;/p&gt;
&lt;p&gt;myFields&lt;/p&gt;
&lt;p&gt;- dataFields&lt;/p&gt;
&lt;p&gt;-- d:Requests&lt;/p&gt;
&lt;p&gt;--- Customers&amp;nbsp;&amp;nbsp; &amp;lt;-- this is where the data for the repeating section is.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Any help would be greatly appreciated!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;ETA:&amp;nbsp; I tried the code below (trying to figure out what&amp;#39;s what).&amp;nbsp; After I submitted a form with 2 instances of the repeating section, objXMLNodes.count was still equal to 1.&amp;nbsp; Am I going about this the wrong way?&lt;/p&gt;&lt;font size="2"&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set objXMLNode = XDocument.DOM.selectSingleNode(&amp;quot;//dfs:dataFields/d:Requests/d:Customers&amp;quot;)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XDocument.View.SelectNodes(objXMLNode)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set objXMLNodes = XDocument.View.GetSelectedNodes&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If (objXMLNodes.Count &amp;gt; 0) then &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XDocument.UI.Alert(objXMLNodes(0).nodeName + &amp;quot;\n\n&amp;quot; + objXMLNodes(0).text)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End if&lt;/p&gt;&lt;/font&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>