Hi,
Im having problems with a simple problem.
I’m trying to detect whether users have cookies and Javascript enabled from this tutorial on 4 Guys from Rolla ( [url]http://www.aspfaqs.com/webtech/082400-1.shtml
Heres the code for the page with the hidden field and the javascript function to change the hidden field.
<%@LANGUAGE=”VBSCRIPT” CODEPAGE=”1252″%>
<html>
<head>
<script language=”JavaScript”>
<!-
function cc()
{
/* check for a cookie
if (document.cookie == “”)
{
/* if a cookie is not found – alert user –
change cookieexists field value to false
alert(“COOKIES need to be enabled!”);
/* If the user has Cookies disabled an alert will let him know
that cookies need to be enabled to log on.*/
document.Form1.cookieexists.value =”false”
} else {
/* this sets the value to true and nothing else will happen,
the user will be able to log on
document.Form1.cookieexists.value =”true”
}
}
/* Set a cookie to be sure that one exists.
Note that this is outside the function
document.cookie = ‘killme’ + escape(‘nothing’)
// –>
</script>
<title>Untitled Document</title>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>
</head>
<body onLoad=”cc()”>
<form action=”check2.asp” method=”post” name=”Form1″ id=”Form1″>
<input type=”hidden” name=”cookieexists” value=”false”><input name=”Submit” type=”submit” value=”Submit”>
</form>
</body>
</html>
Thanks for any advice
Craig