473,486 Members | 2,353 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

form submit new page

It's there any way to submit a form with target set to "_blank" (a new page)

Thanks
Jul 20 '05 #1
6 6314
"Bob Bedford" <be******@YouKnowWhatToDohotmail.com> writes:
It's there any way to submit a form with target set to "_blank" (a new page)


<form action="..." target="_blank">

Remember to use HTML 4.01 Transitional as DOCTYPE.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2
Bob Bedford wrote:
It's there any way to submit a form with target set to "_blank" (a new page)

Thanks


<form name="myForm" action="mycgi.cgi" method="POST" target="_blank">

--
| Grant Wagner <gw*****@agricoreunited.com>

* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/...ce/frames.html

* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/a...ence_entry.asp

* Netscape 6/7 DOM Reference available at:
* http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 7 / Mozilla
* http://www.mozilla.org/docs/web-deve...upgrade_2.html
Jul 20 '05 #3
@SM
Bob Bedford a ecrit :

It's there any way to submit a form with target set to "_blank" (a new page)

Thanks


you give the answer !

<form action=blabla target="_blank">
--
******** (enlever/remove [OTER_MOI] du/from reply url) *******
Stéphane MORIAUX : mailto:st*********************@wanadoo.fr
Aide aux Pages Perso (images & couleurs, formulaire, CHP, JS)
http://perso.wanadoo.fr/stephane.moriaux/internet/
************************************************** ************
Jul 20 '05 #4
My question wasn't so clear (probably, as reading again, it was incomplete).

In my script I do a test. If the test is True, the target is the current
page, otherwise it's a _blank page.

So it's not in my form where I must set the target, but in the javascript.
I've an other method: set 2 forms with different target and fires the
desidered one, but I'm sure it can be done with only one frame.

BoB

"@SM" <st*********************@wanadoo.fr> a écrit dans le message de
news:40***************@wanadoo.fr...
Bob Bedford a ecrit :

It's there any way to submit a form with target set to "_blank" (a new page)
Thanks


you give the answer !

<form action=blabla target="_blank">
--
******** (enlever/remove [OTER_MOI] du/from reply url) *******
Stéphane MORIAUX : mailto:st*********************@wanadoo.fr
Aide aux Pages Perso (images & couleurs, formulaire, CHP, JS)
http://perso.wanadoo.fr/stephane.moriaux/internet/
************************************************** ************

Jul 20 '05 #5
@SM
Bob Bedford a ecrit :

My question wasn't so clear (probably, as reading again, it was incomplete).

In my script I do a test. If the test is True, the target is the current
page, otherwise it's a _blank page.


it is not so hard to do !

=== examples ===
document.myForm.action="aNewPage.htm"/"special.cgi"/"resolve.php";
document.myForm.target="_blank"/"_self"/"MyFrame"/"MyPopUp";
document.myForm.method="post"/"get";

to add an option to select "MySelect" :
with(document.MyForm.MySelect) {
var i = options.length;
options[i].value = 'page1.htm';
options[i].text = 'To go to Page 1';
options[0].selected = false; // true;
options[i].selected = true; // false;
}
=== end examples ===

<form action="blabla" target="" id="Myform" name="Myform">

to add to your script before submitting

if(document.getElementById)
DF= document.getElementById('Myform');
else
DF= document.forms['Myform'];
DF.target = (MyTest)? "_self" : "_blank";

Take care :
you cannot put this condition in a *onsubmit*
if you use the function submit()
to send your form
--
******** (enlever/remove [OTER_MOI] du/from reply url) *******
Stéphane MORIAUX : mailto:st*********************@wanadoo.fr
Aide aux Pages Perso (images & couleurs, formulaire, CHP, JS)
http://perso.wanadoo.fr/stephane.moriaux/internet/
************************************************** ************
Jul 20 '05 #6
Merci Stéphane ;-)

"@SM" <st*********************@wanadoo.fr> a écrit dans le message de
news:40***************@wanadoo.fr...
Bob Bedford a ecrit :

My question wasn't so clear (probably, as reading again, it was incomplete).
In my script I do a test. If the test is True, the target is the current
page, otherwise it's a _blank page.


it is not so hard to do !

=== examples ===
document.myForm.action="aNewPage.htm"/"special.cgi"/"resolve.php";
document.myForm.target="_blank"/"_self"/"MyFrame"/"MyPopUp";
document.myForm.method="post"/"get";

to add an option to select "MySelect" :
with(document.MyForm.MySelect) {
var i = options.length;
options[i].value = 'page1.htm';
options[i].text = 'To go to Page 1';
options[0].selected = false; // true;
options[i].selected = true; // false;
}
=== end examples ===

<form action="blabla" target="" id="Myform" name="Myform">

to add to your script before submitting

if(document.getElementById)
DF= document.getElementById('Myform');
else
DF= document.forms['Myform'];
DF.target = (MyTest)? "_self" : "_blank";

Take care :
you cannot put this condition in a *onsubmit*
if you use the function submit()
to send your form
--
******** (enlever/remove [OTER_MOI] du/from reply url) *******
Stéphane MORIAUX : mailto:st*********************@wanadoo.fr
Aide aux Pages Perso (images & couleurs, formulaire, CHP, JS)
http://perso.wanadoo.fr/stephane.moriaux/internet/
************************************************** ************

Jul 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4173
by: Michael Brennan-White | last post by:
If I submit my for using a get action the resulting page loads . If I use a post action I get an error page saying "The page cannot be found". I am calling the originating page!!! This happens...
8
3030
by: Matt | last post by:
I want to submit the form to the server without opening another page. When we do the following, it will submit the form data in myform to the IIS, and open page2.asp. <form name="myform"...
2
73346
by: Terence Parker | last post by:
How does one go about submitting a form with a link - but submitting it to a new window AND to a page different to that described within the action="" option of the <form> tag? Say, for example,...
6
3066
by: CJM | last post by:
Can somebody clarify if/how/when a simple form is submitted when the <Enter> key is pressed? As I understood it, if you have a form with a single submit button, if enter is pressed, the form...
5
8393
by: rjames.clarke | last post by:
I have the following. $result=mysql_query($sql); $nrows=mysql_num_rows($result); for ($i=0;$i<$nrows;$i++) { $row_array=mysql_fetch_row($result); echo "<form name='testform'...
0
1870
by: 42 | last post by:
I implemented a simple class inherited from Page to create a page template. It simply wraps some trivial html around the inherited page, and puts the inherited page into a form. The problem I...
9
14677
by: Mark | last post by:
I have a lengthy form (i.e., many inputs) on my form.php page. What's different about this form than many others I've created is that I want the user to have a choice of submitting this form data...
4
2603
by: Greg Scharlemann | last post by:
I'm trying to setup a dyamic dropdown list that displays a number of text fields based on the selected number in the dropdown. The problem I am running into is capturing the data already entered...
26
2780
by: Jerim79 | last post by:
I need to create a form that takes a number that the user enters, and duplicates a question the number of times the user entered. For instance, if the customer enters 5 on the first page, when...
4
5494
by: j1dopeman | last post by:
Hi, I'd like to use a button to save and then submit a form. I can set the onlick of the button to mahButton_click or submit, but I can't figure out how to do both. It looks like c# can't...
0
7105
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
6967
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
7132
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
7180
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
5439
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,...
1
4870
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4564
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
3076
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3071
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.