gpt4 book ai didi

html - 发布 html 表单数据重定向

转载 作者:可可西里 更新时间:2023-11-01 17:35:29 25 4
gpt4 key购买 nike

我正在使用 HTML post 和 action attr 将模态数据发布到后端。表单发布正常并更新后端,唯一的事情是在按下提交 url 更改并将我带到我的 POST url 之后。这怎么能停止?我想在单击提交后留在同一页面上,只进行后端更新而不被带到我的 POST url。

<form method="POST"id="goForm"action="http://post_endpoint"enctype="application/x-www-form-urlencoded">
Name: <input type="text" value="">
<button type="submit value="submit">Send<button>

</form>

最佳答案

要在不重新加载页面的情况下提交 HTML 表单,您必须使用 Javascript。

这是一个带答案的类似问题:Submit form without page reloading

关于html - 发布 html 表单数据重定向,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32486210/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com