PDA

View Full Version : Open a new window for "form"



jya
December 21st, 2001, 23:27
The following is the sample code, it is for a
simple poll program. The script willl shows
the result once the vote button is pressed
( in the same browser window ).

My qestion is, how can I open up a new window
instead for the result ? So that I can keep the
default page for the existing browser.

-------------------
<form action=poll.php method=post>
What is your favorite programming language?<br>
<input type=radio name=vote value=HTML> HTML<br>
<input type=radio name=vote value=JavaScript> JavaScript<br>
<input type=radio name=vote value=Perl> Perl<br>
<input type=radio name=vote value=PHP> PHP<br>
<input type=submit value=Vote>
</form>
---------------------

Bruce
December 21st, 2001, 23:29
Just add target="_blank" in the form tag.



<form action=poll.php method=post target="_blank">

jya
December 21st, 2001, 23:38
Thanks for the fast reply.

However, I've just tested your suggestion, but it does not work.

Any idea ?

Dusty
December 22nd, 2001, 10:43
That's the correct syntax, it should work fine. What browser are you using?

jya
December 23rd, 2001, 20:05
Sorry, it is my mistake ( I've edited wrong file for testing ),
it works!

BTW, how do I use javascript for this case ?

Thank you very much for reply.