两个表单操作,在一个提交按钮的新窗口中打开URL? [英] Two Form Action that opens URL in a new window in One Submit button?

查看:112
本文介绍了两个表单操作,在一个提交按钮的新窗口中打开URL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以将两个表单动作放在一个提交按钮中?用户将能够选择两个单选按钮,每个表单操作将同时在新窗口中打开URL。我不知道该怎么做,也没有太多的编码知识。此代码不是我的,我只是想修改。 :(b / b)

这里的代码是:

 < form action = http://thegreatpromocode.tk/lite/jonsnow/subscribemethod =postclass =form-subscribe- 
promotarget =fooonsubmit =window.open
(' ','foo','width = 450,height = 250,status = no,resizable = no,scrollbars = no')>

< input type =radioname = promo_codevalue =BlueGem> BlueGem< br>
< input type =radioname =promo_codevalue =RedGem> RedGem< br>
< input type = radioname =promo_codevalue =GreenGem> GreenGem< br>
< input type =radioname =promo_codevalue =WhiteGem> WhiteGem< br>
< input type =radioname =promo_codevalue =YellowGem> YellowGem< br>
< input type =radioname =promo_codevalue =DarkGem> DarkGem< ; br>
< input type =radioname =promo_codevalue =OrangeGem> OrangeGem< br>
< input type =radio name =promo_codevalue =VioletGem> VioletGem< br>
< input type =hiddenname =subscribervalue =temporary>
< input>hiddenname =promo_namevalue =GemStone>< hr>
< center>< input type =textname =User IDsize =18onblur =if

(this.value =='')

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

this.value ='';} value =11位移动号码>
< input type =submitvalue =确认>< / form>


解决方案

试试这个:

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


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>

解决方案

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

这篇关于两个表单操作,在一个提交按钮的新窗口中打开URL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆