473,466 Members | 1,511 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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

-----------------------------------------------------------------------
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
4 1395
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Matt | last post by:
Is it possible to post form data and open an invisible window? For example, in page1.as <form action="page2.asp" method="POST" It will post the form data from page1.asp to the server, and...
1
by: humbads | last post by:
I am trying to get a popup window to work for editing notes in my application. Here's how I implemented it: The original frame is called ORIGINALFRAME and contains a link like this: <a...
2
by: gialby | last post by:
Ciao i have this problem.... i have a main asp page with this code PARENT PAGE <script language="vbScript"> function ricerca() ...
10
by: morangolds | last post by:
Hi, I've been having a problem with C++ Windows Forms apps not "ending" when you close the form window. I've searched about this problem all over the place and most searches have lead me to...
3
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - I have window.status="Moomin"; why doesn't the statusbar change?...
3
by: toddw607 | last post by:
Hello All, I am using Access 2003 and when I view a report from a form and close the print preview window for the report to return to the form the form window shifts from being...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.