HTML按钮定位



我在页面上有两个按钮和两个不同的帧。单击按钮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>

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

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

最新更新