Det er vist ikke helt så let. Du kan jo sende parametre med når du refresher. Simplest mulige ekxempel vill være:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
http://www.w3.org/TR/html4/loose.dtd"> <html>
<head>
<title>Untitled</title>
<script type="text/javascript">
function getParams() {
params = location.href.split("?");
if (params.length>=2) {
paramset = params[1].split("&");
for (i=0;i!=paramset.length;i++) {
temp = paramset[i].split("=");
if (temp.length!=2) throw new Error("Malformed URL parameter: "+paramset[i]);
eval(temp[0]+"=\""+temp[1]+"\"");
}
}
}
function assignParams() {
getParams();
try {
if (t1) document.f.t1.value=t1;
if (t2) document.f.t1.value=t1;
if (t3) document.f.t1.value=t1;
} catch(e) {}
}
onload = assignParams;
</script>
</head>
<body>
<form name="f" id="f">
<input type="text" name="t1" id="t1" value="r1">
<input type="text" name="t2" id="t2" value="r2">
<input type="text" name="t3" id="t3" value="r3">
<input type="submit" value="Test">
</form>
</body>
</html>