<?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: Validation and Button-click code</title><link>https://www.infopathdev.com:443/forums/thread/50270.aspx</link><pubDate>Sat, 02 Jan 2010 18:40:05 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:50270</guid><dc:creator>ricomarcelo</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/50270.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=50270</wfw:commentRss><description>&lt;p&gt;Hi Hilary,&lt;/p&gt;&lt;p&gt;Thank you very much for replying. I really appreciate your help.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;- Rick &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Validation and Button-click code</title><link>https://www.infopathdev.com:443/forums/thread/50264.aspx</link><pubDate>Sat, 02 Jan 2010 13:27:57 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:50264</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/50264.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=50264</wfw:commentRss><description>&lt;p&gt;In the code for your button, you can check your form for errors prior to running the logic:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;if&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; (&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;this&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.Errors.Count &amp;gt; 0)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;return&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;; &lt;/p&gt;&lt;/blockquote&gt;&lt;/font&gt;
&lt;p&gt;for example....&lt;/p&gt;
&lt;p&gt;More info is available at &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.office.infopath.formerrorcollection(VS.80).aspx"&gt;MSDN....&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Validation and Button-click code</title><link>https://www.infopathdev.com:443/forums/thread/50251.aspx</link><pubDate>Thu, 31 Dec 2009 20:07:25 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:50251</guid><dc:creator>ricomarcelo</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/50251.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=50251</wfw:commentRss><description>&lt;p&gt;Hello Everybody,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m new to InfoPath as a matter of fact I just started using this application this month. I use InfoPath2007 and code in C#. I have added a button on my form that adds rows to a repeating table. I also added rules to this button to validate other fields on the form for example... show messages when some required fields are blank. Now the problem is whether the validation results with error or not, the button click code&amp;nbsp;still gets fired.&amp;nbsp;What I want is for the button-click code not to get processed when there&amp;#39;s any validation error. How do I prevent the click code from doing its thing when there&amp;#39;s any validation error? Should I resort to coding the validation routine&amp;nbsp;instead of using rules to validate fields? Any help would be greatly appreciated.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Rick&lt;/p&gt;</description></item></channel></rss>