I'm using a browser-enabled Infopath form with Sharepoint 2010 and I want to show a modal popup or even redirect to another page after clicking on Submit, saying "Thank you... Your form has been sent...".
I can't use a View (and change to that view on submit) because the form is inside a 'tab' in the page. I mean, the page contains 5 DIVs acessible through 5 buttons. The DIV which is open by default is the 1st one. The form is inside the 5th DIV. After the submit action (postback) the page reloads and the 1st DIV is shown, so the user can't see the View with "Thank you...."
Any ideias on how to solve this? Thanks in advance!
EDIT 2
I tried Andreas' solution but didn't work. This is my "submit" button code.
public void CTRL114_5_Clicked(object sender, ClickedEventArgs e)
{
try
{
SPSecurity.RunWithElevatedPrivileges(delegate()
{
this.Submit();
HttpContext.Current.Response.Redirect("ThankYou.aspx");
});
} catch (Exception ex)
{
System.Console.Write(ex.toString());
}
}
When I click on Submit, nothing happens. No page redirection, no view switching, no data submitting. Any ideas? Thank you!