首页 > 解决方案 > HTML 表单接受/拒绝按钮

问题描述

所以我有这个带有两个按钮的 HTML 表单,分别是“接受”和“拒绝”。

<div class="disclaimerAD top">
    <form enctype="application/x-www-form-urlencoded" action="index.html" method="post">

<input type="hidden" name="id" value="5" id="id">

<input type="hidden" name="process" value="1" id="process">

<input type="submit" name="accept" id="accept" value="Accept">

<input type="submit" name="decline" id="decline" value="Decline"></form>    </div>


<form enctype="application/x-www-form-urlencoded" action="index.html" method="post">

<input type="hidden" name="id" value="5" id="id">

<input type="hidden" name="process" value="1" id="process">

<input type="submit" name="accept" id="accept" value="Accept">

<input type="submit" name="decline" id="decline" value="Decline"></form>

这不是我的代码,我不知道为什么有两个。

现在点击“接受”或“拒绝”会将用户带到“index.html”。但我想点击“Accept”将用户带到“index.html”并点击“Decline”来刷新页面,这称为“5.html”。我怎样才能让它工作?

标签: htmlforms

解决方案


删除 Decline 输入字段并改用指向 5.html 的链接。如果需要,您可以使用 CSS 使它们看起来相同。


推荐阅读