From: FAQ server on
-----------------------------------------------------------------------
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=""
target="wndname" onsubmit="window.open('',this.target,'features');return true;">

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.

From: Osmo Saarikumpu on
FAQ server kirjoitti:
> -----------------------------------------------------------------------
> 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=""
> target="wndname" onsubmit="window.open('',this.target,'features');return true;">

ISTM, that:

1) The above example code would need the method attribute with the post
value in order to "POST" it, (as GET is the default value)?

2) Perhaps the empty action attribute is a little misleading?

3) Perhaps the feature part could be dropped completely, as it is
optional and the author should not nowadays expect new windows anyway?

--
Best wishes,
Osmo
From: Garrett Smith on
Osmo Saarikumpu wrote:
> FAQ server kirjoitti:

[...]

>> <form action=""
>> target="wndname"
>> onsubmit="window.open('',this.target,'features');return true;">
>
> ISTM, that:
>
> 1) The above example code would need the method attribute with the post
> value in order to "POST" it, (as GET is the default value)?
>

Right.

> 2) Perhaps the empty action attribute is a little misleading?
>

The base URL should be used.

> 3) Perhaps the feature part could be dropped completely, as it is
> optional and the author should not nowadays expect new windows anyway?
>
Of course, also, literally, "features" would not do anything useful.
--
Garrett
comp.lang.javascript FAQ: http://jibbering.com/faq/
From: Dr J R Stockton on
In comp.lang.javascript message <4b3e8c8a$0$283$14726298(a)news.sunsite.dk
>, Sat, 2 Jan 2010 00:00:03, FAQ server <javascript(a)dotinternet.be>
posted:
>
>Use the target attribute on the form, opening a window with
>that name and your feature string in the onsubmit handler of the
>FORM.

The words "target" and "onsubmit" should be differently rendered, using
quotes, italics, <code>, <var>, <tt>, or suchlike. Similar cases can
probably be found elsewhere, e.g. "confirm".

Fragment "if not" should be "if that is not".

In 8.8, A) & B) should start a line or become (A) & (B).

--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME.
Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
Proper <= 4-line sig. separator as above, a line exactly "-- " (RFCs 5536/7)
Do not Mail News to me. Before a reply, quote with ">" or "> " (RFCs 5536/7)