【问题标题】:how to link a form with one input submit with two links如何将表单与一个输入链接提交与两个链接
【发布时间】:2019-12-17 20:30:20
【问题描述】:

我正在使用formsubmit.co 从我的联系页面发送html 信息

<form method="post" action = "https://formsubmit.co/ahmedoher01@gmail.com" enctype="multipart/form-data" novalidate>

到我的电子邮件,我现在使用它,它工作得很好,我使用了这个代码

<input type="hidden" name="_next" value="www.paypal.com">

现在提交后转到另一个页面我也想在提交后打开一个新的空白,在客户提交后解释更多转到 paypal 并在空白处打开一个新页面,例如 google ,感谢所有愿意提供帮助的人

【问题讨论】:

  • @swati 你能帮忙吗?

标签: javascript jquery html forms form-submit


【解决方案1】:

按钮

<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title></title>
<script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256- 
WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin="anonymous"> 
</script>
</head>
<body>
<form name="myform" id="submitForm" method="post"></form>
<input type="button" id="btnClick" onclick="return onButtonSubmitClick()" 
name="submit" value="submit" />
<script>
    $(document).ready(function () {
        $('#btnClick').on('click', function () {
            document.forms["myform"].submit();
            window.open("https://www.google.com","_blank");
        });
    });
</script>
</body>
</html>

【讨论】:

  • @AhmedSyam 这行不通。两者都提交了相同的这个。
  • @AhmedSyam 您在按钮中添加了 onButtonSubmitClick() 函数?
  • @AhmedSyam
  • ` ` 是
  • @AhmedSyam 更改按钮类型提交到按钮。并在 buttonclick 上手动提交表单。
猜你喜欢
  • 2014-04-10
  • 1970-01-01
  • 2019-07-02
  • 2020-06-20
  • 2019-08-25
  • 2015-08-11
  • 1970-01-01
  • 2013-02-19
  • 1970-01-01
相关资源
最近更新 更多