By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,921 Members | 1,479 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,921 IT Pros & Developers. It's quick & easy.

FAQ Topic - How do I POST a form to a new window? (2008-01-16)

P: n/a
-----------------------------------------------------------------------
FAQ Topic - How do I POST a form to a new window?
-----------------------------------------------------------------------

You 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');r eturn true;">

http://www.htmlhelp.com/reference/ht...orms/form.html
--
Postings such as this are automatically sent once a day. Their
goal is to answer repeated questions, and to offer the content to
the community for continuous evaluation/improvement. The complete
comp.lang.javascript FAQ is at http://jibbering.com/faq/index.html.
The FAQ workers are a group of volunteers. The sendings of these
daily posts are proficiently hosted by http://www.pair.com.

Jan 16 '08 #1
Share this Question
Share on Google+
4 Replies


P: n/a
FAQ server wrote:
-----------------------------------------------------------------------
FAQ Topic - How do I POST a form to a new window?
-----------------------------------------------------------------------

You 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');r eturn true;">

http://www.htmlhelp.com/reference/ht...orms/form.html

I've been trying to get this to open a new (i.e. separate) window but it
"always" opens a new tab in FF2 and IE7. So, I think, you should modify
the FAQ topic accordingly.

Andrew Poulos
Jan 16 '08 #2

P: n/a
Thomas 'PointedEars' Lahn wrote:
Andrew Poulos wrote:
>FAQ server wrote:
>>-----------------------------------------------------------------------
FAQ Topic - How do I POST a form to a new window?
-----------------------------------------------------------------------

You 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');r eturn true;">

I don't think `return true;' is necessary here. If the `submit' event is
not explicitly cancelled, the form is submitted.
>>http://www.htmlhelp.com/reference/ht...orms/form.html
I've been trying to get this to open a new (i.e. separate) window but it
"always" opens a new tab in FF2 and IE7. So, I think, you should modify
the FAQ topic accordingly.

Since there are many factors that influence whether a window or tab is
opened, that would be premature.
I built a test piece and its working??? That is, it is opening a new
window. I'm unsure why it wasn't working just yesterday. If I find
anything reproducible I'll post it.

Andrew Poulos
Jan 16 '08 #3

P: n/a
In comp.lang.javascript message <47**************@PointedEars.de>, Wed,
16 Jan 2008 03:07:34, Thomas 'PointedEars' Lahn <Po*********@web.de>
posted:
>Andrew Poulos wrote:
>I've been trying to get this to open a new (i.e. separate) window but it
"always" opens a new tab in FF2 and IE7. So, I think, you should modify
the FAQ topic accordingly.

Since there are many factors that influence whether a window or tab is
opened, that would be premature.
A foolish remark. "How do I POST a form to a new window or tab?"
covers the situation. The subsequent text can deal with selection of
one or the other.

</FAQENTRY>
Why doesn't the onsubmit event handler get called then formRef.submit()
is used?
<//FAQENTRY>

Too geeky. It will not attract the attention of those wanting the
answer to the original Subject question. OTOH, those who read it
carefully will notice that it's not semantically well-formed.

--
(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.

Food expiry ambiguities: <URL:http://www.merlyn.demon.co.uk/date2k-3.html#Food>
Jan 16 '08 #4

P: n/a
Dr J R Stockton wrote:
[...] Thomas 'PointedEars' Lahn [...] posted:
>Andrew Poulos wrote:
>>I've been trying to get this to open a new (i.e. separate) window but it
"always" opens a new tab in FF2 and IE7. So, I think, you should modify
the FAQ topic accordingly.
Since there are many factors that influence whether a window or tab is
opened, that would be premature.

A foolish remark.
It wasn't. Andrew observed a behavior that was not in accordance with the
FAQ, so it was necessary to make sure that the observed behavior was
reproducible before the FAQ was changed. Because nobody is perfect; well,
apart from Dr J R Stockton, of course ... (*HUALP*)
"How do I POST a form to a new window or tab?" covers the situation.
Nonsense.
PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f8*******************@news.demon.co.uk>
Jan 17 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.