【问题标题】:How i can export the action to two differents pages from submit button? [closed]如何从提交按钮将操作导出到两个不同的页面? [关闭]
【发布时间】:2020-08-19 09:46:45
【问题描述】:

这有点愚蠢,但我不知道。 我如何从提交按钮将操作导出到两个不同的部分? 我希望取消按钮将我带到一个页面,而接受按钮将我带到另一个页面。如何应用执行不同操作的条件?

我的按钮是接受和取消...

<section>
      <form action="/news">
           <input type="submit" id="button" value="Accept"> <input type="submit" class="button2" value="Cancel">
      </form>
</section>

【问题讨论】:

  • export the action 是什么意思?
  • 我希望取消按钮将我带到一个页面,而接受按钮将我带到另一个页面。如何应用执行不同操作的条件?

标签: php html forms button submit


【解决方案1】:
<!doctype html>
<html>
    <head>
    </head>
    <body>
        <form action="submit.html">
            <label for="name">Name</label>
            <input type="text" name="name">
            <label for="lastname">Last Name</label>
            <input type="text" name="lastname">
            <button type="submit" id="submit">submit</button>
            <button type="cancel" formaction="cancel.html">cancel</button>
        </form>
    </body>
</html>

基本上使用 html 你可以像这样的形式做出不同的动作

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-12-13
    • 1970-01-01
    • 1970-01-01
    • 2014-10-02
    • 2020-01-20
    • 1970-01-01
    • 1970-01-01
    • 2012-08-09
    相关资源
    最近更新 更多