Two Form Action that opens URL in a new window in One Submit button?

非 Y 不嫁゛ 提交于 2019-12-12 13:48:32

问题


Is it possible to Put Two Form action in one submit button?? the user will able to select two radio buttons and each form action will open the URL in a new window simultaneously. I don't know how to do it and I don't have much knowledge in coding. This code is not mine and I just want to modify. :(

here's the code:

<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:


Try this:

<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;">


来源:https://stackoverflow.com/questions/14018180/two-form-action-that-opens-url-in-a-new-window-in-one-submit-button

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!