如何防止“确认表单重新提交”对话? [英] How to prevent the "Confirm Form Resubmission" dialog?

查看:971
本文介绍了如何防止“确认表单重新提交”对话?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在提交后清除表单中的信息,以便在页面刷新后不会显示此错误?



查看图片(来自Chrome):



对话框包含文本:


您正在寻找的页面使用

信息您输入。返回

页面可能会导致您执行的任何操作,

重复。您要继续吗?


我想要此对话框不显示。

解决方案

它与您的表单或其中的值无关。它被浏览器触发,以防止用户使用缓存的数据重复相同的请求。如果您真的需要启用结果页面的刷新,您应该通过PHP( header('Location:result.php'); )或其他您使用的服务器端语言。 Meta标记解决方案也应该可以禁用刷新时重新发送。


How do I clean information in a form after submit so that it does not show this error after a page refresh?

See image (from chrome):

The dialog has the text:

The page that you're looking for used
information that you entered. Returning to that
page might cause any action you took to be
repeated. Do you want to continue?

I want this dialog not to appear.

解决方案

It has nothing to do with your form or the values in it. It gets fired by the browser to prevent the user from repeating the same request with the cached data. If you really need to enable the refreshing of the result page, you should redirect the user, either via PHP (header('Location:result.php');) or other server-side language you're using. Meta tag solution should work also to disable the resending on refresh.

这篇关于如何防止“确认表单重新提交”对话?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆