0
我在瀏覽器中返回時很難維護複選框的禁用狀態。如何在使用返回到頁面時保持複選框禁用狀態?
我已經創建了這兩個示例頁面來演示我的問題。
爲了確保複選框在返回上一頁時保持禁用狀態,我需要做些什麼?
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>
您可以添加一個JavaScript函數來設置cookie並在onload上檢查它。 – Blazemonger