<?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: Multi-select check box with repeating table contro</title><link>https://www.infopathdev.com:443/forums/thread/13146.aspx</link><pubDate>Tue, 15 Feb 2005 18:09:22 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:13146</guid><dc:creator>rrs</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/13146.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=13146</wfw:commentRss><description>Awesome. Thanks a lot Greg. It worked.&lt;br /&gt;The following is the javascript function. This applies only when you check the "All" office check-box.&lt;br /&gt;&lt;br /&gt;function msoxd_my_officeSelected::OnAfterChange(eventObj)&lt;br /&gt;{&lt;br /&gt;	if( eventObj.Operation == "Insert" )&lt;br /&gt;	{&lt;br /&gt;&lt;br /&gt;		//XDocument.UI.Alert(eventObj.Site.selectSingleNode( "../my:officeSelectedText").text); &lt;br /&gt;	&lt;br /&gt;		// if all offices are checked.&lt;br /&gt;		if ((eventObj.Site.selectSingleNode( "../my:officeSelected").text == "true") &amp;&amp; (eventObj.Site.selectSingleNode( "../my:officeSelectedText").text == "All"))&lt;br /&gt;		{&lt;br /&gt;			var items = XDocument.DOM.selectNodes("/my:myFields/my:officesAffected/my:officeAffected/my:officeSelected[. != 'true']")&lt;br /&gt;			&lt;br /&gt;			for (var i=0;i&amp;lt;items.length;i++)&lt;br /&gt;			{&lt;br /&gt;				items(i).text = "true"&lt;br /&gt;			}&lt;br /&gt;		}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Thanks</description></item><item><title>Re: Multi-select check box with repeating table contro</title><link>https://www.infopathdev.com:443/forums/thread/13145.aspx</link><pubDate>Tue, 15 Feb 2005 15:15:55 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:13145</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/13145.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=13145</wfw:commentRss><description>I don't know exactly what your schema looks like, so I'm taking a stab in the dark here...&lt;br /&gt;&lt;br /&gt;It looks like you are trying to perform the "ALL" functionality in this code. You don't want to waste time selecting a check box that is already selected, so you only want to get those that are not selected. So the XPath might look something like:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;selectNodes("/my:myFields/my:officesAffected/my:OfficeAffected[. != 'true']")&lt;/pre&gt;&lt;br /&gt;Once you have your collection of unselected check boxes, then you just loop through them as you are doing and set their value as selected:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;items(i).text = "true"&lt;/pre&gt;&lt;br /&gt;Greg Collins [InfoPath MVP]</description></item><item><title>Re: Multi-select check box with repeating table contro</title><link>https://www.infopathdev.com:443/forums/thread/13144.aspx</link><pubDate>Mon, 14 Feb 2005 19:37:21 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:13144</guid><dc:creator>rrs</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/13144.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=13144</wfw:commentRss><description>I am having problem in setting the check box value. I was able to loop thru all the value but having trouble is setting the specific node. Please see code below.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;if( eventObj.Operation == "Insert" )&lt;br /&gt;{&lt;br /&gt;    if ((eventObj.Site.selectSingleNode( "../my:officeSelected").text == "true") &amp;&amp; (eventObj.Site.selectSingleNode( "../my:officeSelectedText").text == "All"))&lt;br /&gt;    {&lt;br /&gt;        var items = XDocument.DOM.selectNodes("/my:myFields/my:officesAffected/my:officeAffected");&lt;br /&gt;        for (var i=0;i&amp;lt;items.length;i++)&lt;br /&gt;        {&lt;br /&gt;            XDocument.UI.Alert(items(i).text);&lt;br /&gt;            // this is where I am confused. &lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Thanks a lot.&lt;br /&gt;</description></item><item><title>Re: Multi-select check box with repeating table contro</title><link>https://www.infopathdev.com:443/forums/thread/13143.aspx</link><pubDate>Fri, 11 Feb 2005 20:32:44 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:13143</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/13143.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=13143</wfw:commentRss><description>First off, during the OnValidate event, the DOM is read-only... so you must do this with the OnAfterChange event.&lt;br /&gt;&lt;br /&gt;Secondly, so long as there is some metadata on each node to identify it as International or not, then you can do what you want.&lt;br /&gt;&lt;br /&gt;OnAfterChange for the ALL check box would walk through each node and check it if it is not already checked.&lt;br /&gt;&lt;br /&gt;OnAfterChange for the International check box would walk through each node and first see if it is &amp;quot;International&amp;quot;, and if so, then check it if it is not already checked.&lt;br /&gt;&lt;br /&gt;Greg Collins [InfoPath MVP]</description></item><item><title>Multi-select check box with repeating table contro</title><link>https://www.infopathdev.com:443/forums/thread/12421.aspx</link><pubDate>Fri, 11 Feb 2005 00:58:39 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:12421</guid><dc:creator>rrs</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/12421.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=12421</wfw:commentRss><description>My requirement is as follows:&lt;br /&gt;&lt;br /&gt;Have a list of all offices as check box and the first 2 check box is defined as "All" and "International Offices" and the rest are all defined as "Washington","New York" etc. &lt;br /&gt;&lt;br /&gt;I should be able to select all the offices automatically when I click "ALL" and when I click "International Offices" I should be able to select all international offices.&lt;br /&gt;&lt;br /&gt;I had a repeating table control and check box as a field. I added the values by clicking the Tools/Default value and chose the Group to add values into the repeating table.&lt;br /&gt;&lt;br /&gt;Is it possible to loop through the repeating table (like nodes ) using the validate event and select the rest of the fields dynamically based on "All"/ "Intl. offices" selected.&lt;br /&gt;&lt;br /&gt;Hope I am making sense. Please let me know if its possible.&lt;br /&gt;&lt;br /&gt;Thanks a ton!&lt;br /&gt;&lt;br /&gt;Rajesh&lt;br /&gt;</description></item></channel></rss>