Why does this not work. I am not seeing it:
<!-- saved from url=(0022) -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<html xmlns="<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Personal Preferences</title>
<script type="JavaScript">
function setCookie() {
var expiresDate = new Date();
expiresDate.setFullYear(expiresDate.getFullYear() +1);
document.cookie = encodeURI("user_name=" + document.forms[0].user_name.value) + "; expires=" + expiresDate.toUTCString();
document.cookie = encodeURI("user_color=" + document.forms[0].user_color.value) + "; expires=" + expiresDate.toUTCString();
window.alert("Your name and favorite color have been saved in a cookie.");
}
</script>
</head>
<body>
<form action="">
<p>Name: <input type="text" name="user_name" /><br />
Favorite color: <input type="text" name="user_color" /></p>
<p><input type="button" value="Set Cookie" onclick="setCookie();" /></p>
</form>
</body>
</html>
<!-- saved from url=(0022) -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<html xmlns="<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Personal Preferences</title>
<script type="JavaScript">
function setCookie() {
var expiresDate = new Date();
expiresDate.setFullYear(expiresDate.getFullYear() +1);
document.cookie = encodeURI("user_name=" + document.forms[0].user_name.value) + "; expires=" + expiresDate.toUTCString();
document.cookie = encodeURI("user_color=" + document.forms[0].user_color.value) + "; expires=" + expiresDate.toUTCString();
window.alert("Your name and favorite color have been saved in a cookie.");
}
</script>
</head>
<body>
<form action="">
<p>Name: <input type="text" name="user_name" /><br />
Favorite color: <input type="text" name="user_color" /></p>
<p><input type="button" value="Set Cookie" onclick="setCookie();" /></p>
</form>
</body>
</html>