<?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>General</title><link>https://www.infopathdev.com:443/forums/41.aspx</link><description>If you're not sure where to ask your question, ask it here. If necessary, our moderators will make sure it gets classified in the correct board.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>e-mail cancel button error</title><link>https://www.infopathdev.com:443/forums/thread/39816.aspx</link><pubDate>Sun, 22 Mar 2009 13:07:48 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:39816</guid><dc:creator>zone2112</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/39816.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=39816</wfw:commentRss><description>&lt;p&gt;I am&amp;nbsp;using a e-mail data connection to send&amp;nbsp;the form&amp;#39;s data&amp;nbsp;and I have a button that calls up&amp;nbsp;SubmitEmail using code.&amp;nbsp; The e-mail GUI message window shows up, however if&amp;nbsp;the&amp;nbsp;user chooses to press cancel an error appears&amp;nbsp;with the following error message.&amp;nbsp; My goal is try to prevent this error message. I am new to the whole jscript coding. Any suggestions would be helpful.&lt;/p&gt;
&lt;p&gt;The following error occurred:&lt;/p&gt;
&lt;p&gt;InfoPath cannot submit the form.&lt;br /&gt;An error occurred while the form was being submitted.&lt;br /&gt;The form was not submitted because the action was canceled.&lt;/p&gt;
&lt;p&gt;File:script.js&lt;br /&gt;Line:40&lt;/p&gt;
&lt;p&gt;The code is as follows:&lt;/p&gt;
&lt;p&gt;function SubmitEmail::OnClick(eventObj) &lt;/p&gt;
&lt;p&gt;{ // Write your code here var objError; var objEmailAdapter;&lt;/p&gt;
&lt;p&gt;var varTo = XDocument.DOM.selectSingleNode(&amp;quot;/my:myFields/my:Emailinfo/mh:To&amp;quot;);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;// var varCC = XDocument.DOM.selectSingleNode(&amp;quot;/my:myFields/my:EmailInfo/my:CC&amp;quot;); &lt;/p&gt;
&lt;p&gt;var varSubject = XDocument.DOM.selectSingleNode(&amp;quot;/my:myFields/my:Subject&amp;quot;); &lt;/p&gt;
&lt;p&gt;objEmailAdapter = XDocument.DataAdapters(&amp;quot;IMemail&amp;quot;); &lt;/p&gt;
&lt;p&gt;objEmailAdapter.To = (&lt;a href="mailto:e-mail@address.com"&gt;e-mail@address.com&lt;/a&gt;); &lt;/p&gt;
&lt;p&gt;// objEmailAdapter.CC = varCC.text; &lt;/p&gt;
&lt;p&gt;// objEmailAdapter.BCC = varBCC.text; &lt;/p&gt;
&lt;p&gt;objEmailAdapter.Intro = ( &amp;quot;Introtest&amp;quot;); &lt;/p&gt;
&lt;p&gt;// objEmailAdapter.AttachmentFileName = &amp;quot;&amp;quot;; &lt;/p&gt;
&lt;p&gt;objEmailAdapter.Submit(); &lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>