<html>
<head>
<title>Hidden Var Test</title>
<script language="JavaScript">
var holder = ""
var backup = ""
function postData(value) {
backup = holder
holder = value
}
function resetValue() {
var len = document.form1.itemList.length
for (var i=0; i<len; i++) {
if (document.form1.itemList[i].value == backup) {
document.form1.itemList[i].checked = "1"
break
}
}
}
</script>
</head>
<body>
<form name="form1" method="POST">
<p><input type=radio name="itemList" value="A" onClick="postData(this.value)">A</p>
<p><input type=radio name="itemList" value="b" onClick="postData(this.value)">b</p>
<p><input type=radio name="itemList" value="C" onClick="postData(this.value)">C</p>
<p><input type=radio name="itemList" value="D" onClick="postData(this.value)">D</p>
<p><input type=radio name="itemList" value="E" onClick="postData(this.value)">E</p>
<p><input type=radio name="itemList" value="F" onClick="postData(this.value)">F</p>
<p><input type=radio name="itemList" value="G" onClick="postData(this.value)">G</p>
<p><input type=radio name="itemList" value="H" onClick="postData(this.value)">H</p>
<p><input type=button name="UndoLast" value="Undo Last" onClick="resetValue()"></p>
</form>
</body>
</html>
|