<?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: Define the value of a checkbox</title><link>https://www.infopathdev.com:443/forums/thread/13222.aspx</link><pubDate>Thu, 19 May 2005 19:07:13 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:13222</guid><dc:creator>Agni Jonnalagadda</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/13222.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=13222</wfw:commentRss><description>This can be done through InfoPath itself. You can have rule on "field4", In the you need to specify a condition and check what is the 10th character in the string, you can use InfoPath substring functions for this.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Agni&lt;br /&gt;InfoPathDev India</description></item><item><title>Define the value of a checkbox</title><link>https://www.infopathdev.com:443/forums/thread/12452.aspx</link><pubDate>Wed, 18 May 2005 08:00:26 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:12452</guid><dc:creator>Coita Thierry</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/12452.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=12452</wfw:commentRss><description>Hi,&lt;br /&gt;&lt;br /&gt;I try to do some C# for check my checkbox in Infopath:&lt;br /&gt;&lt;br /&gt;Depend on a binary value (for example = 00000000001000000000000001000000)&lt;br /&gt;&lt;br /&gt;I want to make a substring of the 10th number for see if is value is 1. If it is I wan't to check my checkbox.&lt;br /&gt;&lt;br /&gt;With a text label I can make that in design I can assign a value depend of a substring.&lt;br /&gt;&lt;br /&gt;With the rules I can't because substring is not accessible!&lt;br /&gt;&lt;br /&gt;So I try with C# but my code don't work:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;[InfoPathEventHandler(MatchPath="/ns1:source/ns1:tabMuster/ns1:Muster/@ns1:Flags", EventType=InfoPathEventType.OnAfterChange)]&lt;br /&gt;public void Flags_attr_OnAfterChange(DataDOMEvent e)&lt;br /&gt;{&lt;br /&gt;IXMLDOMNode toto = thisXDocument.DOM.selectSingleNode("/ns1:source/ns1:tabMuster/ns1:Muster/ns1:field4");&lt;br /&gt;IXMLDOMNode Flags = thisXDocument.DOM.selectSingleNode("/ns1:source/ns1:tabMuster/ns1:Muster/@ns1:Flags");&lt;br /&gt;			&lt;br /&gt;if( Flags.text.Substring(10)=="1")&lt;br /&gt;{&lt;br /&gt;toto.text="1";&lt;br /&gt;//thisXDocument.DOM.replaceChild(Flag,thisXDocument.DOM.selectSingleNode("/ns1:source/ns1:tabMuster/ns1:Muster/ns1:field4"));&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;What I'm doing wrong? Any idea about how to to that(in design or with C#)?&lt;br /&gt;&lt;br /&gt;Thanks a lot for your help it's very appreciated!&lt;br /&gt;&lt;br /&gt;Thierry&lt;br /&gt;&lt;br /&gt;P.S. Sorry for my English&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Every moment hesitated is a moment gone for life!!! Think about it</description></item></channel></rss>