<?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>Browser Forms</title><link>https://www.infopathdev.com:443/forums/40.aspx</link><description>For browser form specific questions</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: cancelling code submit not working</title><link>https://www.infopathdev.com:443/forums/thread/47565.aspx</link><pubDate>Sat, 03 Oct 2009 03:01:18 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:47565</guid><dc:creator>Qazi Anis</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/47565.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=40&amp;PostID=47565</wfw:commentRss><description>&lt;p&gt;you might consider submitting the form on a normal buttton instead of a submit button, in that case you dont need to set the cancelableargs. drawback of this is that you will have to use a label(textbox) to give the status to the user. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>cancelling code submit not working</title><link>https://www.infopathdev.com:443/forums/thread/47541.aspx</link><pubDate>Fri, 02 Oct 2009 14:00:21 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:47541</guid><dc:creator>CraigW</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/47541.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=40&amp;PostID=47541</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have a InfoPath 2007 form which is published as a web form in SharePoint.&amp;nbsp; It is submitted programatically using custom code.&amp;nbsp; This works fine, except in the case that there are validation error with the form.&amp;nbsp; If there are errors, the following message is shown:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;An error occurred while the form was being submitted. &lt;br /&gt;The submit event handler returned a value indicating that the submit failed.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;In my submit handler I have the followig:&lt;/p&gt;
&lt;p&gt;if (this.Errors.Count == 0)&lt;br /&gt;{&lt;/p&gt;
&lt;p&gt;&amp;nbsp;//do submit here&lt;/p&gt;
&lt;p&gt;e.CancelableArgs.Cancel = false&lt;/p&gt;
&lt;p&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;/p&gt;
&lt;p&gt;e.CancelableArgs.Cancel = true;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;Setting e.CancelableArgs.Cancel = true seems not&amp;nbsp;to be stopping forms services from attempting to submit the form, and so the error is shown.&lt;/p&gt;
&lt;p&gt;Has anyone got an idea on how to ensure the form is valid before it is submitted, or cancel submission in a submit handler properly?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Craig&lt;/p&gt;</description></item></channel></rss>