两个表单操作,在一个提交按钮的新窗口中打开URL?

时间:2012-12-24 07:03:22

标签: forms action

是否可以在一个提交按钮中放置两个表单操作?用户可以选择两个单选按钮,每个表单操作将同时在新窗口中打开URL。我不知道怎么做,我对编码知之甚少。这段代码不是我的,我只想修改。 :(

这是代码:

<form action="http://thegreatpromocode.tk/lite/jonsnow/subscribe" method="post" class="form-subscribe-
promo" target="foo" onsubmit="window.open
('','foo','width=450,height=250,status=no,resizable=no,scrollbars=no')">

        <input type="radio" name="promo_code" value="BlueGem">BlueGem<br>
        <input type="radio" name="promo_code" value="RedGem">RedGem<br>
        <input type="radio" name="promo_code" value="GreenGem">GreenGem<br>
        <input type="radio" name="promo_code" value="WhiteGem">WhiteGem<br>
        <input type="radio" name="promo_code" value="YellowGem">YellowGem<br>
        <input type="radio" name="promo_code" value="DarkGem">DarkGem<br>
        <input type="radio" name="promo_code" value="OrangeGem">OrangeGem<br>
        <input type="radio" name="promo_code" value="VioletGem">VioletGem<br>
        <input type="hidden" name="subscriber" value="temporary">
        <input type="hidden" name="promo_name" value="GemStone"><hr>
        <center><input type="text" name="User ID" size="18" onblur="if

(this.value=='')

{this.value='ID Number';}" onfocus="if(this.value=='ID Number'){ 

this.value='';}" value="11-Digit Mobile Number">
        <input type="submit" value="Confirm"></form>

1 个答案:

答案 0 :(得分:0)

试试这个:

<form action="http://thegreatpromocode.tk/lite/jonsnow/subscribe" 
    method="post" 
    class="form-subscribe-promo" 
    target="_blank" 
    onsubmit="
            window.open('http://www.google.com','New Window 1','width=450,height=250,status=no,resizable=no,scrollbars=no');
            window.open('http://www.stackoverflow.com','New Window 2','width=450,height=250,status=no,resizable=no,scrollbars=no');
            return false;">