GetCookie() not working for me

admin

Administrator
Staff member
I have some javascript on various pages of my site which writes a cookies - PT_ToDoItemX
Where X is a sequential number

i.e. each time a cookie is written the cookie name has a number added 1, 2, etc...
PT_ToDoItem1
PT_ToDoItem2
etc...

for example (this would be writeen if the link was clicked on 2 different pages)

*PT_ToDoItem1Sepia%20Doveswww.mysite.com/1600389541683229536308325929332829536107*PT_ToDoItem2Another%20Cardwww.mysite.com/160088516723229609533315992332829536107*

The information I want to retrieve from above is -
Sepia Doves and Another Card
I want to have the cookies read & the above information included in a form the user fills in, so I tried the following ...

<form method="post" action="/cgi-bin/mailform.pl">
<input type="hidden" name="recipient" value=http://www.webdeveloper.com/forum/archive/index.php/"[email protected]">
<input type="hidden" name="redirect" value="http://www.mysite.com/thanks.htm">
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
document.forms[0].hiddenFieldName.value = GetCookie('PT_ToDoitem');
// End -->
</script>
<input type="hidden" name="hiddenFieldName">
<input type=submit value=http://www.webdeveloper.com/forum/archive/index.php/"Send" name="submit">
<input type=reset value="Clear" name="reset">
</form>

However I keep getting ....
hiddenFieldName: null
... in the resulting email

Which I presume is due somehow to the sequential numbers or the fact that there are more than 1 cookies



Basically I want to have the cookie read & the results included in a form

this is based on
<!-- m --><a class="postlink" href="http://javascript.internet.com/cookies/to-do-list.html">http://javascript.internet.com/cookies/to-do-list.html</a><!-- m -->

Please, can someone help me work out how to do this !!!

Charley Maxwell
:) :) :)
 
Back
Top