Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

FAQ Topic - How do I POST a form to a new window? (2010-08-30)

0 views
Skip to first unread message

FAQ server

unread,
Aug 29, 2010, 7:00:03 PM8/29/10
to
-----------------------------------------------------------------------
FAQ Topic - How do I POST a form to a new window?
-----------------------------------------------------------------------

Use the target attribute on the form, opening a window with
that name and your feature string in the onsubmit handler of the
FORM.

<form action="" method="post"
target="wndname" onsubmit="window.open('',this.target);return true;">

<URL: http://www.htmlhelp.com/reference/html40/forms/form.html>


The complete comp.lang.javascript FAQ is at
http://jibbering.com/faq/

--

The sendings of these daily posts are proficiently hosted
by http://www.pair.com.

Evertjan.

unread,
Aug 30, 2010, 7:11:40 AM8/30/10
to
FAQ server wrote on 30 aug 2010 in comp.lang.javascript:

> -----------------------------------------------------------------------
> FAQ Topic - How do I POST a form to a new window?
> -----------------------------------------------------------------------
>
> Use the target attribute on the form, opening a window with
> that name and your feature string in the onsubmit handler of the
> FORM.
>
> <form action="" method="post"
> target="wndname" onsubmit="window.open('',this.target);return true;">

That is not the anwer to the topic question.

target="wndname" posts to another, possibly new, window or tab.

target="_blank" posts to a new window or tab every time.

So either change the quetion or the answer.

"FAQ Topic - How do I POST a form to a another or new window or tab?"

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Asen Bozhilov

unread,
Aug 30, 2010, 9:36:54 AM8/30/10
to
FAQ wrote:

> Use the target attribute on the form, opening a window with
> that name and your feature string in the onsubmit handler of the
> FORM.
>
> <form action="" method="post"
> target="wndname" onsubmit="window.open('',this.target);return true;">

^^^^^^

The validity of `target` attribute depends on used DTD. I would prefer
to use a little bit different approach.

onsubmit="this.target='wndname';"

0 new messages