Connecting Tech Pros Worldwide Help | Site Map

FAQ Topic - How do I POST a form to a new window?

 
LinkBack Thread Tools Search this Thread
  #1  
Old May 15th, 2007, 11:05 PM
FAQ server
Guest
 
Posts: n/a
Default FAQ Topic - How do I POST a form to a new window?

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


  #2  
Old May 15th, 2007, 11:25 PM
Evertjan.
Guest
 
Posts: n/a
Default Re: FAQ Topic - How do I POST a form to a new window?

FAQ server wrote on 16 mei 2007 in comp.lang.javascript:
Quote:
-----------------------------------------------------------------------
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 ... target="wndname"
onsubmit="window.open('',this.target,'features');r eturn true;">
Just:

<form target = '_blank'>

will do fine. Look mam, no js!




--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
  #3  
Old May 16th, 2007, 02:05 AM
ASM
Guest
 
Posts: n/a
Default Re: FAQ Topic - How do I POST a form to a new window?

Evertjan. a écrit :
Quote:
FAQ server wrote on 16 mei 2007 in comp.lang.javascript:
>
Quote:
>-----------------------------------------------------------------------
>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 ... target="wndname"
>onsubmit="window.open('',this.target,'features'); return true;">
>
Just:
>
<form target = '_blank'>
>
will do fine. Look mam, no js!
Without JS, anyway, that code will open another window than main one.

Giving a name to the target, on first call it will open a new window and
on next call(s) will load file(s) in this same new window (unlovely the
old new window passed behind the main one may cause user to meet some
difficulties to realize something happened somewhere)

--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
  #4  
Old May 16th, 2007, 07:55 AM
Evertjan.
Guest
 
Posts: n/a
Default Re: FAQ Topic - How do I POST a form to a new window?

ASM wrote on 16 mei 2007 in comp.lang.javascript:
Quote:
Evertjan. a écrit :
Quote:
>FAQ server wrote on 16 mei 2007 in comp.lang.javascript:
>>
Quote:
>>---------------------------------------------------------------------
>>-- 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 ... target="wndname"
>>onsubmit="window.open('',this.target,'features') ;return true;">
>>
>Just:
>>
><form target = '_blank'>
>>
>will do fine. Look mam, no js!
>
Without JS, anyway, that code will open another window than main one.
>
Giving a name to the target, on first call it will open a new window
and on next call(s) will load file(s) in this same new window
But that was not the subject of this FAQ-entry Q.

So the primary JS solution was wrong too.
Quote:
(unlovely the
old new window passed behind the main one may cause user to meet some
difficulties to realize something happened somewhere)
Eh? Is this a cross browser issue?

Realizing that something happened somewhere is always a difficult task.

That something happened somewhere is a scientific certainty however
and a lovely certainty to the inquisitive mind at that.


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
  #5  
Old May 16th, 2007, 09:25 AM
ASM
Guest
 
Posts: n/a
Default Re: FAQ Topic - How do I POST a form to a new window?

Evertjan. a écrit :
Quote:
ASM wrote on 16 mei 2007 in comp.lang.javascript:
>
Quote:
>Evertjan. a écrit :
Quote:
>>FAQ server wrote on 16 mei 2007 in comp.lang.javascript:
>>>
>>>---------------------------------------------------------------------
>>>-- 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 ... target="wndname"
>>>onsubmit="window.open('',this.target,'features' );return true;">
>>Just:
>>>
>><form target = '_blank'>
>>>
>>will do fine. Look mam, no js!
>Without JS, anyway, that code will open another window than main one.
>>
>Giving a name to the target, on first call it will open a new window
>and on next call(s) will load file(s) in this same new window
>
But that was not the subject of this FAQ-entry Q.
no, only only (extended ?) subject of its answer :
- <form ... target="wndname"
- windox.open('','wndname','');
Quote:
So the primary JS solution was wrong too.
Why ?
With that code, with/without JS, a blank window will really open (if the
user accepts popups), by extension the blank window can be a tab.
Quote:
Quote:
>(unlovely the
>old new window passed behind the main one may cause user to meet some
>difficulties to realize something happened somewhere)
>
Eh? Is this a cross browser issue?
If you want to recall, you have to come back on the mother window (the
daughter, if not closed, moves in back and is not more seen).
When you recall (re submit) result comes in yet existing daughter which
stays behind, user will have to give back focus to her. Will he do it ?
Quote:
Realizing that something happened somewhere is always a difficult task.
>
That something happened somewhere is a scientific certainty however
and a lovely certainty to the inquisitive mind at that.
:-)


--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.