我在一个页面上有多个表单,这些表单使用 PHP 从 Mysql 数据库动态填充。
每个表单都会将数据发布到一个新页面,该页面允许用户“查看更多详细信息”——该页面在新选项卡中打开。
这是我的问题 - 当用户单击“查看更多详细信息”时,它会在新选项卡中打开,但如果他们返回并选择另一个奖学金,它会在已打开的同一选项卡中打开。我希望用户能够从页面上为每个奖学金同时打开多个选项卡。
这是一个 fiddle :https://jsfiddle.net/tcanfarotta22/x64q0597/
这是一个示例表单
<div class='list' style='width:1750px; margin:0 auto;'>
<form action='singleview.php' method='post' target='_new'>
<table id='scholarship' style='float:left;' align='center'>
<thead>
<th class='head' colspan='3' style='text-align:center;'>University of Michigan--Dearborn
<br>
<br>Full Tuition
<br>
<br>Public
<br>
<br>
<input type='hidden' name='id' value='ARLUJ'>
<input type='submit' value='View More Details'>
<br>(Will Open in a New Tab)</th>
</thead>
</form>
</table>
</div>
<div class='list' style='width:1750px; margin:0 auto;'>
<form action='singleview.php' method='post' target='_new'>
<table id='scholarship' style='float:left;' align='center'>
<thead>
<th class='head' colspan='3' style='text-align:center;'>University of Michigan--Dearborn
<br>
<br>$1,500
<br>
<br>Public
<br>
<br>
<input type='hidden' name='id' value='BNAOT'>
<input type='submit' value='View More Details'>
<br>(Will Open in a New Tab)</th>
</thead>
</form>
</table>
</div>
最佳答案
当用户单击然后更改(使用 javascript)target='_new'
如target='_new2'
然后target='_new3'
...等等
关于php - 多个 HTML 表单 POST 数据在新选项卡中打开,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34707205/