Peeja
Peeja

Reputation: 14264

(How) can I open the result of a form submission in a new window?

I have a small form inside a table. POSTing that form creates a new entity. I then want users to see that new entity, but it should open in a new window so that the original view isn't lost.

(How) can I open the result of the form submission in a new window?

Upvotes: 2

Views: 261

Answers (2)

Grant Wagner
Grant Wagner

Reputation: 25931

<form ... target="windowName">

or

<form ... target="windowName" onsubmit="window.open(this.action, this.target, '...attributes...');return true;">

...attributes... can consist of the stuff documented at the mozilla developer center or MSDN

Upvotes: 6

Joel Coehoorn
Joel Coehoorn

Reputation: 415881

One request, one response. That is the way of the web.

If you want a new window after a post, you either need to post the request from the new window in the first place- perhaps opened via javascript- or post your data from that page to the same page and save a token so that when the page re-loads is can open a new windows -again, likely with javascript- and that new window's request already knows about the previous post.

Upvotes: 0

Related Questions