tags:

views:

142

answers:

3

I have a form to sign up to getting a rss feed through Feedburner. this is the code -

<form action="http://feedburner.google.com/fb/a/mailverify" method="post">
    <p><input name="email" type="text" /></p>
<input name="uri" type="hidden" value="dafyomi" /><input name="loc" type="hidden" value="en_US" /><input type="submit" value="click here to send" /></form>
<p> </p>

I want it to also sent the form data to a new window, and also change the window the user is on now - to a thank you page on the site.

Any ideas? Thanks!

+2  A: 

In clean HTML — impossible.

You can use JavaScript for this but it's ugly, breaks usability and probably most browsers will block it thinking you're trying to show an advertisement.

And as forcing opening a new window/tab/whatever is getting deprecated too, some browser may even ignore your ‘new window’ and try to open the thing in current tab. This would lead to undefined behavior of it trying to open two things in same window.

You may think about using one target page and <object/> or frames to display another if that's important. But that's not very usable too.

PS. And in all cases, the form can be submitted only to one of the pages. The second one will be plain GET.

Michał Górny
+1  A: 

I would like to suggest to use jQuery Ajax Form Plugins for this case. You can done two actions with one form submit by this way...

$('form').submit(function() {
    $(this).ajaxSubmit({
        url: myurl,              //ajax request to myurl
        success: function() { 
            return true;         //submit form
        }
    });
    return false;
});
Ei Maung
+1  A: 

I would add the "Thank you!"-phrase to the results page - after all, it can only be a line or two long, right?

If you feel that is not an option, you might want to do the something like this instead:

  1. Form submits to server, and relevant data required to view the results page are saved in a Session
  2. Redirect to Thank You-page, with a link to the results page.
  3. Link triggers GET-request for the results page, and the results can be shown thanks to the Session variable.
  4. If the page should only be available once, abandon the session.
Tomas Lycken