...

View Full Version : URGENT HELP NEEDED with shopping cart web page



HiEverybody
07-12-2004, 10:34 AM
Hi Everyone

My friend asked me to post this question. (It is attached at the bottom)

He does not have internet (Kinda weird) and so he asked me to help him with this question.

He asked me to post his question and said any code or help with the question will help him. I don't think he has started with this question.

Any help will be VERY MUCH APPRECIATED!!!

Hoping to here from someone?

Kor
07-12-2004, 11:10 AM
It looks like your friend wants to do that for a customer or for a job apply. If so, he should not expect us to to his entire job, should he?

There lays a sort of task he must achieve. But we see nothing of his work. We could help him solve a local code problem, give him a clue, check for errors. But we are not to work in his place, no Sir! :D

glenngv
07-12-2004, 11:14 AM
It looks like an assignment. Posting assignments is not allowed here.

http://www.codingforums.com/showthread.php?t=2090#post19911

Garadon
07-12-2004, 11:14 AM
looks like a school assignment from one bored teacher to me.

HiEverybody
07-12-2004, 11:23 AM
I will tell him to work on his code. And when he gets stuck then he must bring me the code that he does not understand then I will post it and you guys can have a look at it.

Thanx for your trouble

Cheers

HiEverybody
07-12-2004, 02:00 PM
My friend gets the error message "object expected" when he clicks on the add to shopping cart link.

What is he doing wrong

Please Help???

Here is the code for the order page:

Code:

<html>
<head>
<title>Easy Credit Online Shopping</title>
<SCRIPT LANGUAGE = Javascript>

</SCRIPT>

</head>

<body bgcolor="#FFFFFF" text="#000000">
<div align="center">
<p><font size="5"><b>Welcome to the Easy Credit Online Shopping Site</b></font>
</p>
<p>&nbsp;</p>
</div>
<hr>
<p align="center">Press 'V' to view your Shopping cart or click <a href="cart.htm">here</a></p>
<table width="70%" border="1" align = "center">
<tr>
<td width="24%" height="37">T-Shirt</td>
<td width="66%" height="37" align="left" valign="middle">
<p align="left">Lime Green T-Shirt with Orange Easy Credit Logo - Small</p>
<p ><a href="javascript:place('T-Shirt - Small')" align="left">Add to Shopping Cart</a></p>
</td>
<td width="10%" height="37">R29.50</td>
</tr>
<tr>
<td width="24%" height="37">T-Shirt</td>
<td width="66%" height="37" align="left" valign="middle">
<p align="left">Lime Green T-Shirt with Orange Easy Credit Logo -Medium</p>
<p ><a href="javascript:place('T-Shirt - Medium')"align="left">Add to Shopping Cart</a></p>
</td>
<td width="10%" height="37">R34.50</td>
</tr>
<tr>
<td width="24%" height="37">T-Shirt</td>
<td width="66%" align="left" valign="middle">
<p align="left">Lime Green T-Shirt with Orange Easy Credit Logo - Large</p>
<p ><a href="javascript:place('T-Shirt - Large')"align="left">Add to Shopping Cart</a></p>
</td>
<td width="10%">R39.50</td>
</tr>
<tr>
<td width="24%" height="37">Capp</td>
<td width="66%" align="left" valign="middle">
<p align="left">Adjustable Lime Green Cap with Orange Easy Credit Logo</p>
<p ><a href="javascript:place('Lime Green Cap')"align="left">Add to Shopping Cart</a></p>
</td>
<td width="10%">R18.75</td>
</tr>
<tr>
<td width="24%" height="37">Capp</td>
<td width="66%" align="left" valign="middle">
<p align="left">Adjustable Orange Cap with Lime Green Cap Easy Credit Logo</p>
<p ><a href="javascript:place('Orange Cap')"align="left">Add to Shopping Cart</a></p>
</td>
<td width="10%">R18.75</td>
</tr>
<tr>
<td width="24%" height="37">Easy Credit Teddy Bear</td>
<td width="66%" align="left" valign="middle">
<p align="left">25cm Tall Lime Green Teddy Bear with Orange T-shirt</p>
<p ><a href="javascript:place('Teddy Bear')"align="left">Add to Shopping Cart</a></p>
</td>
<td width="10%">R66.50</td>
</tr>
</table>
<p align="center">E-mail us for more information: <a href="mailto:easycredit@hotmail.com">easycredit@hotmail.com</a></p>
</body>
</html>

Here is the code for the viewing of the shopping cart page:

Code:

<html>
<head>
<title>Easy Credit Online Shopping</title>
<SCRIPT LANGUAGE = Javascript>

var items_string = "";

function place(new_item)
{
items_string = items_string + "xxx" + new_item;
document.cookie = "items=" + escape(items_string);
}

"items=xxxT-Shirt - Small;xxxT-Shirt - Medium;xxxT-Shirt - Large;xxxLime Green Cap;xxxOrange Cap;xxxTeddy Bear;"
whole_items_cookie = "items=xxxT-Shirt - SmallxxxT-Shirt - MediumxxxT-Shirt - LargexxxLime Green CapxxxOrange CapxxxTeddy Bear";

if (whole_items_cookie !="")
{
items_array = whole_items_cookie.split("xxx");
items_array[0] = "items=";
items_array[1] = "T-Shirt - Small";
items_array[2] = "T-Shirt - Medium";
items_array[3] = "T-Shirt - Large";
items_array[4] = "Lime Green Cap";
items_array[5] = "Orange Cap";
items_array[6] = "Teddy Bear";

}

</script>


</head>

<body bgcolor="#FFFFFF" text="#000000">

<SCRIPT LANGUAGE = Javascript>

if(items_array != "")
{
for (i=1; i < items_array.length; i++)
{
document.write("<h3>" + items_array[i] + "</h3>");
}
}
</script>

</body>

</html>

glenngv
07-13-2004, 02:33 AM
He's calling the place() function that's located in another page? You can't do that if the page that has the place() function is not also loaded. You can call a function from another page if that page is in another frame, iframe or new window. In other words, both pages must be loaded.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum