i have a login page that contains a form with two text boxes
(text1=username, password1). i have written a cookie that is suppose to
display the value of text1 in another page, but the result is not what
has been input into text1, can anybody help?
i have included the relevent code for both pages
thank you in advance
expireDate = new Date
expireDate.setMonth(expireDate.getMonth()+6)
userName = ""
if (document.cookie != "")
{
userName = document.cookie.split("=")[1]
Quote:
}
function setCookie()
{
userName = document.Form1.text1.value
document.cookie = "userName="+userName+";expires=" +
expireDate.toGMTString()
Quote:
}
this is the code that is suppose to display the result on the next page
<H1>
<script language="JavaScript">
if (document.cookie != "")
{
document.write("Hello, "+ document.cookie.split("=")[1])
Quote:
}
</script>
</H1>
Sent via Deja.com http://www.*-*-*.com/
Before you buy.