problems with cookies using javascript
<p>I am creating a very small shopping cart application. the user only has two items to choose from that are located in a table that has 2 rows and 4 columns. what i am trying to do is the user checks the item or both items, enters the price, and also enters the amount. once the add to cart button is click, a cookie gets stored for each item individually. when the user clicks the view cart link, another table is displayed. the information that is displayed in the table is the item name, the price, the quantity, and also the total price for that one item. underneath the table, the value of the cookie is displayed. I don't get any errors when i run my program, but I'm not sure how to get the data that was entered in the 1st table to be displayed in the second table in the view cart's link. also, i'm not sure how to display the value of the cookie. here is the code that i have so far. </p>

<pre><code>&lt;html&gt;

&lt;head&gt;
&lt;title&gt; Store &lt;/title&gt;
&lt;h1&gt; My store &lt;/h1&gt;
&lt;script type="text/javascript"&gt;
function setCookie() 
{
var exdate = new Date();
exdate.setDate(exdate.getDate() +10);
document.cookie = "price="+ document.getElementsByName("Price")[0].value + ";expires=  "+exdate.toGMTString();
 }

function retrieve() 
{
document.getElementsByName("fullName")[0].value = document.cookie;
}

function Calc()
{
if (document.getElementById("calcu")){
var pri = document.getElementById("price").value;
var qty = document.getElementById("quantity").value
Total(pri,qty)
}
}
function Total(pri, qty)
{
var pri = document.getElementById("price").value
var qty = document.getElementById("quantity").value

if (document.getElementById("circle").checked) {
document.getElementById("total").value = pri * qty
}
}
function load()
{
document.getElementById("circle")
}
&lt;/script&gt;

&lt;/head&gt;

&lt;body&gt;
&lt;table border = "1"&gt;
&lt;td&gt; &lt;input type="checkbox" id = "circle"&gt; Circle &lt;/td&gt;
&lt;td&gt; &lt;img src="circle.jpg"&gt; &lt;/td&gt;
&lt;td&gt; Price: &lt;input type = "text" size = "4"  name = "price" /&gt;$ &lt;/td&gt;
&lt;td&gt; Quantity: &lt;input type = "text" size = "4"  id = "quantity"/&gt; &lt;/td&gt;
&lt;tr&gt; &lt;/tr&gt;
&lt;td&gt; &lt;input type = "checkbox"&gt; Stickman &lt;/td&gt;
&lt;td&gt; &lt;img src = "stickman.gif"&gt; &lt;/td&gt;
&lt;td&gt; Price: &lt;input type = "text" size = "4" value = "$" id = "price" /&gt; &lt;/td&gt;
&lt;td&gt; Quantity: &lt;input type = "text" size = "4"  id = "quantity" /&gt; &lt;/td&gt;
&lt;/table&gt;
&lt;br /&gt;
&lt;input type = "button" value = "Add to cart"&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href ="cart.html" onclick = "retrieve()"&gt; View Cart &lt;/a&gt;
&lt;br /&gt; 

&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>here is my other page.</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;title&gt; Cart &lt;/title&gt;
&lt;h1&gt; My cart &lt;/h1&gt;
&lt;script type = "text/javascript"&gt;
function retrieve() 
{
document.getElementsByName("price")[0].value = 

document.cookie;
}
&lt;/script&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;table border = "1"&gt;
&lt;td&gt; Stickman &lt;/td&gt;
&lt;td&gt; &lt;script type = "text/javascript"&gt;document.getElementById("price")  &lt;/script&gt; &lt;/td&gt; 
&lt;td&gt; price per &lt;/td&gt;
&lt;td&gt; total &lt;/td&gt;
&lt;tr&gt; &lt;/tr&gt;
&lt;td&gt; Circle &lt;/td&gt;
&lt;td&gt; quantity order &lt;/td&gt;
&lt;td&gt; price per &lt;/td&gt;
&lt;td&gt; total &lt;/td&gt;
&lt;tr&gt; &lt;/tr&gt;
&lt;td colspan = "3"&gt; TOTAL: &lt;/td&gt;
&lt;td&gt; total price &lt;/td&gt;
&lt;/table&gt; 
&lt;br /&gt; &lt;br /&gt;
&lt;script type="text/javascript"&gt;document.write(retrieve("price")); 

&lt;/script&gt;
&lt;br / &gt; &lt;br /&gt;
&lt;input type = "button" value = "Checkout"&gt;
&lt;br /&gt; &lt;br /&gt;
&lt;a href = "store.html"&gt; Continue Shopping
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
