Hi,
I take it the form is called calc_heat and the text field is called test?
I tested it using your code and worked fine for. Bearing in mind that it was run from a webserver, it will return nothing if its run from a folder.
If you put an Alert(document.referrer) in the code does it still return nothing?
This is what I used...
page 1 code
Code:
<html>
<head>
<title>Untitled</title>
</head>
<body>
<a href="page2.htm">Page2</a>
</body>
</html>
page 2 code
Code:
<html>
<head>
<title>Untitled</title>
<script language="JavaScript" type="text/javascript">
<!--
function tester() {
if (document.referrer == "http://intranet") {
sprog = "Not OK";
document.calc_heat.test.value=sprog;
}
else {
sprog = document.referrer ;
document.calc_heat.test.value=sprog;
}
}
//-->
</script>
</head>
<body onload="tester()">
<form name="calc_heat">
<input type="text" name="test">
</form>
</body>
</html>