<?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: Close a web-based (MOSS) InfoPath 2007 form when using multiple (different) buttons to submit the form</title><link>https://www.infopathdev.com:443/forums/thread/62889.aspx</link><pubDate>Fri, 07 Jan 2011 07:23:49 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:62889</guid><dc:creator>MingleLui</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/62889.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=40&amp;PostID=62889</wfw:commentRss><description>I use the same method,but I got js error too.</description></item><item><title>Re: Close a web-based (MOSS) InfoPath 2007 form when using multiple (different) buttons to submit the form</title><link>https://www.infopathdev.com:443/forums/thread/54003.aspx</link><pubDate>Wed, 21 Apr 2010 21:29:45 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:54003</guid><dc:creator>sonisick</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/54003.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=40&amp;PostID=54003</wfw:commentRss><description>&lt;p&gt;I having trouble redirecting from my submit functions:&lt;/p&gt;
&lt;p&gt;System.Web.HttpContext.Current.Response.Redirect(&amp;quot;http://portal&amp;quot;,false);&lt;/p&gt;
&lt;p&gt;as an ironic twist it actually opened the debugger in the browser but gives me some kind of Javascript Error.&lt;/p&gt;</description></item><item><title>Re: Close a web-based (MOSS) InfoPath 2007 form when using multiple (different) buttons to submit the form</title><link>https://www.infopathdev.com:443/forums/thread/49537.aspx</link><pubDate>Mon, 30 Nov 2009 17:05:30 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:49537</guid><dc:creator>Karsten Brocksieper</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/49537.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=40&amp;PostID=49537</wfw:commentRss><description>&lt;p&gt;Hello Carlos,&lt;/p&gt;
&lt;p&gt;I have done something similar in my own projects --- I always use a popup window to show the infopath form in a browser window --- and after submit I always want to close the form automatically...&lt;/p&gt;
&lt;p&gt;What I have done is the following:&lt;/p&gt;
&lt;p&gt;1. Put a file called &amp;quot;&lt;strong&gt;WindowClose.htm&lt;/strong&gt;&amp;quot; in a folder under &lt;strong&gt;&amp;quot;_layouts/YourApplicationFolder/&lt;/strong&gt;&amp;quot;&lt;/p&gt;
&lt;p&gt;The content of the file is:&lt;/p&gt;
&lt;p&gt;&lt;font face="courier new,courier"&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot; language=&amp;quot;JavaScript&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;self.close();&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;2. In the submit code (I always use my own submit code) you can code:&lt;/p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;// Use the pre-defined Submit-Connection&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;FileSubmitConnection&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; fc = (&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;FileSubmitConnection&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;.DataConnections[&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;SPSubmitForm&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;];&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; Location = &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;.CurrentSiteUrl.ToString();&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; Uri = &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;.CurrentDocLib.ToString();&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; Path = Uri.Substring(0, Uri.LastIndexOf(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;/&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;));&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; Folder = Path.Substring(Path.LastIndexOf(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;/&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;) + 1);&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; closeWindowPath = &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;/_layouts/YourApplicationFolder/windowclose.htm&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;// Exceute Submit&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;fc.FolderUrl = Location + &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;/&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; + Folder;&lt;br /&gt;fc.Execute();&lt;/p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;// Redirect/Close des Formulars&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;HttpContext&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.Current.Response.Redirect(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.Concat(Location, closeWindowPath), &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;false&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;Now after submit the form window will be closed...&lt;/p&gt;
&lt;p&gt;Hope that helps,&lt;/font&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Close a web-based (MOSS) InfoPath 2007 form when using multiple (different) buttons to submit the form</title><link>https://www.infopathdev.com:443/forums/thread/49514.aspx</link><pubDate>Mon, 30 Nov 2009 13:12:56 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:49514</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/49514.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=40&amp;PostID=49514</wfw:commentRss><description>&lt;p&gt;Sorry, meant xdExtension. Here&amp;#39;s one article: &lt;a href="http://www.infopathdev.com/blogs/greg/archive/2004/09/15/Use-Code-to-Determine-a-Rule-Condition.aspx"&gt;http://www.infopathdev.com/blogs/greg/archive/2004/09/15/Use-Code-to-Determine-a-Rule-Condition.aspx&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Re: Close a web-based (MOSS) InfoPath 2007 form when using multiple (different) buttons to submit the form</title><link>https://www.infopathdev.com:443/forums/thread/49512.aspx</link><pubDate>Mon, 30 Nov 2009 12:27:41 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:49512</guid><dc:creator>carlosq</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/49512.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=40&amp;PostID=49512</wfw:commentRss><description>&lt;p&gt;Hello Patrick,&lt;/p&gt;&lt;p&gt;Thanks for answering. Can you clarify how to use &amp;quot;xdExpression&amp;quot;? I search on Google gives 4 results, all in this site, and 3 of them says to do a search in this forum but no one actually explains what xdExpression is or how to use it. I am using InfoPath 2007 and web-based forms (InfoPath Form Services).&lt;/p&gt;&lt;p&gt;Thanks in advance,&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Carlos &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Close a web-based (MOSS) InfoPath 2007 form when using multiple (different) buttons to submit the form</title><link>https://www.infopathdev.com:443/forums/thread/49497.aspx</link><pubDate>Mon, 30 Nov 2009 04:52:10 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:49497</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/49497.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=40&amp;PostID=49497</wfw:commentRss><description>&lt;p&gt;Hi Carlos,&lt;/p&gt;
&lt;p&gt;Thanks for the detailed question. Sorry for the delay in responding.&lt;/p&gt;
&lt;p&gt;You can use xdExpression to call out to code that validates via a rules condition section and use actions to Submit and Close the form if that succeeds. That would be one way to use a custom rule on a button with code to validate, submit and close the form.&lt;/p&gt;
&lt;p&gt;Hope that helps!&lt;/p&gt;</description></item><item><title>Close a web-based (MOSS) InfoPath 2007 form when using multiple (different) buttons to submit the form</title><link>https://www.infopathdev.com:443/forums/thread/49409.aspx</link><pubDate>Wed, 25 Nov 2009 14:43:55 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:49409</guid><dc:creator>carlosq</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/49409.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=40&amp;PostID=49409</wfw:commentRss><description>&lt;p&gt;Hello,&lt;/p&gt;&lt;p&gt;I am developing a web-based form with InfoPath 2007 that is hosted in MOSS (InfoPath Forms Services, FormServer.aspx)&lt;/p&gt;&lt;p&gt;The form is used in a workflow provided by a 3rd party product that integrates with MOSS and InfoPath.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Rather than using the toolbar with the &amp;quot;Send&amp;quot; button provided by InfoPath, the form uses buttons inside it, with actions such as &amp;quot;Submit&amp;quot;, &amp;quot;Accept&amp;quot;, &amp;quot;Reject&amp;quot;, &amp;quot;Return to sender&amp;quot;, etc. depending on the view used by the workflow.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The fields of the form have complex business validations that require code to perform them. Some of them must be performed before the form is submitted (not tied to the Changed or Validating events of fields).&lt;/p&gt;&lt;p&gt;After performing those validations, if they pass, the form must be submitted &lt;b&gt;and closed (redirecting to previous web page or to a custom one)&lt;/b&gt;. I have everything done except the part of closing the form:&lt;/p&gt;&lt;p&gt;The buttons have the action &amp;quot;Rules and custom code&amp;quot; and in the custom code I perform the validations and if successful I execute a connection to submit the form. At that point, I would like to close the form programmatically but it seems (searching the web) that there is no way to close programmatically a web-based form handled by FormServer.aspx. I have tried adding a reference to System.Web and getting the HttpContext and then all kinds of tricks such as HttpContext.Response.Redirect or HttpContext.Server.Transfer. All of them either are ignored or cause an error (InfoPath Form Service shows an error).&lt;/p&gt;&lt;p&gt;It seems that the only way to close a web-based form is to set the button action to &amp;quot;Submit&amp;quot;, and in the Submit Options:&lt;/p&gt;&lt;p&gt; - Set the Custom Code radiobutton&lt;br /&gt;&lt;/p&gt;&lt;p&gt;- In the Advanced section, set the value &amp;quot;Close the form&amp;quot; in the combobox. &lt;br /&gt;&lt;/p&gt;&lt;p&gt;But using the custom code radiobutton I get the same FormEvents_Submit event handler for all the buttons, and it seems that there is no way to get the button that was clicked, so I can&amp;#39;t do different things depending on the button that was clicked.&lt;/p&gt;&lt;p&gt;So, is there a way in web-based forms of &lt;/p&gt;&lt;p&gt;a) having different submit buttons with custom code &lt;/p&gt;&lt;p&gt;b) that perform different validations (depending on the button clicked) before actually submitting the form through a connection and &lt;/p&gt;&lt;p&gt;c) then closing it (or redirecting it to some custom web page)?&lt;/p&gt;&lt;p&gt;Thanks in advance,&lt;/p&gt;&lt;p&gt;Carlos Quintero&lt;/p&gt;&lt;p&gt;Visual Basic MVP &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>