I think that you can do it like this:
<form name=3D"frmAddnews" target=3D"_blank" action=3D"preview.asp">
But, of course, if you want different URLs, just a new window for
preview etc you can do it in a JS function:
function previewButtonClicked(){
document.frmAddnews.action =3D "preview.asp";
document.frmAddnews.target =3D "_blank";
document.frmAddnews.submit();=09
}
This was tested in:
IE 6
Opera 6.03
Netscape Communicator 4.79
Netscape 6.2
Netscape 7
/Robert
-----Ursprungligt meddelande-----
Fr=E5n: Awdhil [mailto:Awdhil@g...]
Skickat: den 12 september 2002 11:06
Till: javascript
=C4mne: [javascript] Window Open
Hi:
My situation is this.
- I have a form in which there are 2 buttons, of which one is SUBMIT.
----- working fine
- I put one more button within this form now, which should generate a
preview in the new window
Since i already have a submit in the form, i used JavaScript to submit
this form. But the page
should open in a new window not the same.
The code is appended below, with certain commented items tht i tried
and not working.
function gopreview()
{
var pop =3D
window.open("preview.asp","width=3D260,height=3D35");
//pop.document.open();
//document.frmAddnews.action =3D
window.open("preview.asp","width=3D260,height=3D35");
//document.frmAddnews.submit();
}
The ordinary submit works
document.form.action=3D"preview.asp"
document.form.submit();
Regards
Syed Awdhil Ahmed
September 12, 2002
---
Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
r-20