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/
************************************************** ************