gpt4 book ai didi

javascript - 用 php 定位空白

转载 作者:行者123 更新时间:2023-11-30 12:08:52 25 4
gpt4 key购买 nike

我想,如果您在提交按钮上,单击该页面会转到另一个页面,然后会打开一个包含另一个页面的新窗口。

这是我的html代码

<div class="knop">
<form action="" method="post">
<input target="blank" class="bal" type="submit" name="bal" value="">
</form>

这是我的 php 代码

if(isset($_POST['bal'])){
header("Location: ping_pong_uitleg.php");//gaat naar de uitleg}

在 html 中放一个链接不是一个选项,因为它必须用提交按钮完成更多的事情

希望你能帮帮我

最佳答案

不要使用 target="_blank"在提交按钮或任何按钮中。这是没有用的。 target="_blank"用于 anchor <a></a>标签

对于提交按钮,使用 formtarget="_blank"

<div class="knop">
<form action="" method="post">
<input class="bal" type="submit" formtarget="_blank" name="bal" value="">
</form>

更多信息,查看我的回答Hyperlink not working on input type=button

根据用户要求。

创建一个 id对于 submit按钮即SubmitId , 使用这个 id.click.基本上,它会做的是:它将转到下一页,同时,它会更改 current Page (Ist Page) URL。也是。

<form method='post' action="">
<input type='text'>
<input type='submit' id='SubmitId' formtarget="_blank">
</form>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("#SubmitId").click(function(){
window.location.href = "http://www.example.com/";
});
});
</script>

关于javascript - 用 php 定位空白,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34418282/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com