【问题标题】:HTML button targetingHTML 按钮定位
【发布时间】:2017-05-04 05:46:57
【问题描述】:

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

【问题讨论】:

标签: javascript html button iframe target


【解决方案1】:

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-01-27
    • 2014-08-19
    • 1970-01-01
    • 2010-11-14
    • 1970-01-01
    • 2013-02-27
    相关资源
    最近更新 更多