<?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>Newbie Questions</title><link>https://www.infopathdev.com:443/forums/39.aspx</link><description>New to InfoPath? Search to see if your question has already been answered. If it has not, then ask it here or the appropriate topic forum.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Using VSTA for writing custom validation</title><link>https://www.infopathdev.com:443/forums/thread/44592.aspx</link><pubDate>Sat, 18 Jul 2009 07:34:14 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:44592</guid><dc:creator>moggy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/44592.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=44592</wfw:commentRss><description>&lt;p&gt;ah yes, that makes sense much easier than VSTA.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;thanks very much for that solution&lt;/p&gt;</description></item><item><title>Re: Using VSTA for writing custom validation</title><link>https://www.infopathdev.com:443/forums/thread/44590.aspx</link><pubDate>Sat, 18 Jul 2009 07:07:52 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:44590</guid><dc:creator>warrtalon</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/44590.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=44590</wfw:commentRss><description>&lt;p&gt;Super easy, I think:&lt;/p&gt;
&lt;p&gt;Place conditional formatting on your submit button (assuming a custom, non-code submit button on the canvas that triggers the submit to db) that has this expression:&lt;/p&gt;
&lt;p&gt;concat(my:Box1, my:Box2, my:Box3, my:Box4, my:Box5, my:Box6, my:Box7) = &amp;quot;falsefalsefalsefalsefalsefalsefalse&amp;quot;&lt;/p&gt;
&lt;p&gt;You basically create a condition that says, &amp;quot;The expression: concat(my:Box1, my:Box2, my:Box3, my:Box4, my:Box5, my:Box6, my:Box7) = &amp;quot;falsefalsefalsefalsefalsefalsefalse&amp;quot;, then disable this control.&lt;/p&gt;
&lt;p&gt;This assumes your boolean fields default to &amp;quot;false&amp;quot; when not checked.&amp;nbsp; If it&amp;#39;s something else like FALSE, False, or No, then substitute the 7 falses with 7 of whatever you need.&amp;nbsp; The concat is adding each box&amp;#39;s value together in a string, and when all unchecked ,the string should be false 7 times.&amp;nbsp; Any time a box is checked, that value changes to true, and the button will become enabled.&amp;nbsp; If the user checks a box and then unchecks it, the condition is triggered again.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Using VSTA for writing custom validation</title><link>https://www.infopathdev.com:443/forums/thread/44589.aspx</link><pubDate>Sat, 18 Jul 2009 06:47:22 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:44589</guid><dc:creator>moggy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/44589.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=44589</wfw:commentRss><description>&lt;p&gt;There has to be at least one box checked it would be allowed to check all 7 boxes (though unlikely to happen)&lt;/p&gt;
&lt;p&gt;It is the main data source&amp;nbsp; and the form is built on the schema from a database and writes back to a sql server database. It does not involve a web service.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;The controls should not get disabled, I want the form to throw an error and prevent submission of the form until at least one of thse check boxes have been ticked&lt;/p&gt;</description></item><item><title>Re: Using VSTA for writing custom validation</title><link>https://www.infopathdev.com:443/forums/thread/44587.aspx</link><pubDate>Sat, 18 Jul 2009 03:29:08 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:44587</guid><dc:creator>warrtalon</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/44587.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=44587</wfw:commentRss><description>&lt;p&gt;I&amp;#39;m thinking that would be very easy, but I still need to know _exactly_ what you want to do.&amp;nbsp; All you said was, &amp;quot;when a person adds a record, the logic is that one of these 7 check boxes has been ticked.&amp;quot;&amp;nbsp; Ok, what does that mean?&amp;nbsp; Is this a form built on the schema of a database, and you are reading/writing to the DB?&amp;nbsp; Is it based on a web service that reads/writes to the DB?&amp;nbsp; Is the DB data source your main data source or a secondary data source?&lt;/p&gt;
&lt;p&gt;I&amp;#39;m trying to figure out what people do when they fill out the form.&amp;nbsp; Are they filling out a row that has 7 boolean columns, and they should only be allowed to fill out one?&amp;nbsp; If they do one, do you want to disable the others?&amp;nbsp; Why do you want it only on the submit?&amp;nbsp; what if they mess up?&amp;nbsp; You&amp;#39;d rather them get an error instead of not being allowed commit the error?&lt;/p&gt;</description></item><item><title>Re: Using VSTA for writing custom validation</title><link>https://www.infopathdev.com:443/forums/thread/44585.aspx</link><pubDate>Sat, 18 Jul 2009 01:52:33 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:44585</guid><dc:creator>moggy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/44585.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=44585</wfw:commentRss><description>&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/infopathdev/images/icon-quote.gif"&gt; &lt;strong&gt;warrtalon:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt; 
&lt;p&gt;Sure, only 5 per condition, but you can stack additional conditions after that.&amp;nbsp; You can also concatenate the values of the checkboxes to a hidden field and do a comparison.&amp;nbsp; There is much you can do, but we need to know your EXACT scenario and all possible permutations of the logic?&lt;/p&gt;
&lt;p&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;
&lt;p&gt;It is a fairly simple form&lt;/p&gt;
&lt;p&gt;It is one table in the db for this part of the logic.&lt;/p&gt;
&lt;p&gt;There are roughly 7 columns in the table that are boolean (not a great db design but I am stuck with it).&lt;/p&gt;
&lt;p&gt;When a person adds a record, the logic is that one of these 7 columns (check boxes) has been ticked.&amp;nbsp; That is it.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t want the validation in the individual events for the controls, just on the submit form.&lt;/p&gt;</description></item><item><title>Re: Using VSTA for writing custom validation</title><link>https://www.infopathdev.com:443/forums/thread/44584.aspx</link><pubDate>Sat, 18 Jul 2009 01:47:26 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:44584</guid><dc:creator>moggy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/44584.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=44584</wfw:commentRss><description>&lt;p&gt;wow, now that is a great tip thanks&lt;/p&gt;</description></item><item><title>Re: Using VSTA for writing custom validation</title><link>https://www.infopathdev.com:443/forums/thread/44579.aspx</link><pubDate>Fri, 17 Jul 2009 23:08:18 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:44579</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/44579.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=44579</wfw:commentRss><description>&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/infopathdev/images/icon-quote.gif"&gt; &lt;strong&gt;moggy:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;Looking at code samples I need a good knowledge of xPath, which is not something I have used before, so I do not understand the syntax that I need to get hold of the check box controls.&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;Try opening the Data Source taskpane, right-clicking one of the fields to which your one of your checkboxes is bound, and selecting &lt;b&gt;Copy XPath&lt;/b&gt;.&amp;nbsp; Some aspects of XPath can be very simple as soon as you get used to it.&lt;/p&gt;&lt;p&gt;But if you can get by without using code for this, I would highly recommend it. &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Using VSTA for writing custom validation</title><link>https://www.infopathdev.com:443/forums/thread/44574.aspx</link><pubDate>Fri, 17 Jul 2009 22:30:22 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:44574</guid><dc:creator>warrtalon</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/44574.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=44574</wfw:commentRss><description>&lt;p&gt;Sure, only 5 per condition, but you can stack additional conditions after that.&amp;nbsp; You can also concatenate the values of the checkboxes to a hidden field and do a comparison.&amp;nbsp; There is much you can do, but we need to know your EXACT scenario and all possible permutations of the logic?&lt;/p&gt;</description></item><item><title>Re: Using VSTA for writing custom validation</title><link>https://www.infopathdev.com:443/forums/thread/44573.aspx</link><pubDate>Fri, 17 Jul 2009 22:25:59 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:44573</guid><dc:creator>moggy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/44573.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=44573</wfw:commentRss><description>&lt;p&gt;well from what I undestand you can only validate up to 5 conditions per control which is not enough in this case. If there is a simpler way to do it I would prefer that.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Looking at code samples I need a good knowledge of xPath, which is not something I have used before, so I do not understand the syntax that I need to get hold of the check box controls.&lt;/p&gt;</description></item><item><title>Re: Using VSTA for writing custom validation</title><link>https://www.infopathdev.com:443/forums/thread/44532.aspx</link><pubDate>Fri, 17 Jul 2009 13:46:45 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:44532</guid><dc:creator>Alec Pojidaev</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/44532.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=44532</wfw:commentRss><description>&lt;p&gt;VSTA for that kind of problem? You have to really love pain.&lt;/p&gt;</description></item><item><title>Using VSTA for writing custom validation</title><link>https://www.infopathdev.com:443/forums/thread/44517.aspx</link><pubDate>Fri, 17 Jul 2009 00:09:14 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:44517</guid><dc:creator>moggy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/44517.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=44517</wfw:commentRss><description>&lt;p&gt;This is the first application I have done in ifo path and I need to write some custom validation. I am familiar with visual studio and I know how to create the event stubbs, but I can&amp;#39;t find any sample code as to how to access the controls on the form.&lt;/p&gt;
&lt;p&gt;I want to write something along the lines of&lt;/p&gt;
&lt;p&gt;if checkbox1 and checkbox 2 and checkbox 3 and checkbox 4 and checkbox 5 but not checkbox 6 then&lt;/p&gt;
&lt;p&gt;raise error&lt;/p&gt;
&lt;p&gt;end if&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;how do i refer to checkboxes on the form and their values&lt;/p&gt;</description></item></channel></rss>