[英]How to maintain checkbox disabled state when returning to page using Back?
返回浏览器时,我难以维护复选框的禁用状态。
我创建了这两个示例页面来演示我的问题。
为了确保返回上一页时该复选框保持禁用状态,我需要怎么做?
test1.html
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<form id="test" action="/">
System <input type="checkbox" id="chkSystem148" onclick="this.disabled = true;"/>
<a href="test2.html">Go to test2</a>
</form>
</body>
</html>
test2.html
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<input type="button" value="Go Back" onclick="history.back(-1); return false;" />
</body>
</html>
正如mblase75所说,请使用cookie。 或其他形式的永久性存储,例如本地存储。 散列也可能有效,如果现场添加了哈希,或者仅在允许将项目推送到历史的较新的浏览器中,就不要记得当场。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.