HTML按钮目标

时间:2017-05-04 05:46:57

标签: javascript html button iframe target

我在页面上有两个按钮和两个不同的框架。单击按钮1时,我希望它显示在第a帧上,当单击按钮2时,我希望它显示在第b帧上。出于某种原因,我无法在不同的帧上显示按钮。只有一帧。

进行了一些测试,似乎唯一的目标是第一个表格动作标签。按钮标签中的目标是无用的。

请帮忙!

<body>
<center>
<form action="test.php" method="post" target="frame_a">
<button type="submit" name="action" value="Active" 
target="frame_a">Active</button>
<button type="submit" name="action1" value="Completed" 
formaction="test2.php" target="frame_b">Completed</button>
</td>
</form>

<iframe width="900" height="1000" src="" name="frame_a" width="100%" 
height="100%"></iframe>

<iframe width="900" height="1000" src="" name="frame_b" width="100%" 
height="100%"></iframe>

</body>

1 个答案:

答案 0 :(得分:0)

尝试将按钮放在单独的表单中

<form action="test.php" method="post" target="frame_a">
    <button type="submit" name="action" value="Active" 
target="frame_a">Active</button>
</form>

<form action="test.php" method="post" target="frame_b">
    <button type="submit" name="action1" value="Completed" formaction="test2.php" target="frame_b">Completed</button>
</form>
相关问题