/    Sign up×
Community /Pin to ProfileBookmark

shopping cart problem

Hello
I downloaded this script from the internet, its just a basic shopping cart
anyway when i try to run the coding I get this error message: –

Line 25
Error: – Object doesn’t support this property or method

this is the coding: –

[code=php]

<!DOCTYPE HTML PUBLIC “-//IETF//DTD HTML//EN”>
<html>

<head>
<title></title>

<script language=javascript>
<!– hide

function write_to_field(code)
{
var found = false;
var i =0;
while ((found == false) && (i < document.form1.elements.length))
{i = i + 1
if (document.form1.elements[i].name == code)
{
found = true;
document.form1.elements[i].value = parent.item_quan(code);
}
}
}

function Loc_additem(code,price,desc,url)
{
self.parent.additem(code,price,desc,url);
write_to_field(code)
}

function Loc_subitem(code,price,desc)
{
self.parent.subitem(code,price,desc);
write_to_field(code)
}

function update_thiselem_page()
{
if (self!=parent)
parent.update_this_page()
}

<!– End –>
</script>

</head>

<body bgcolor=”#FFFFFF” alink=”#FF0000″ onload=update_thiselem_page()>
<form name=form1>

<!– The script below is activated when this page is displayed outside of the frame model –>

<script language=javascript>
<!– hide
if (self==parent){document.write(‘<center><font color=#ff000><b>THIS IS A FRAME ELEMENT : GO TO <a href=index.htm>Start Page</a> TO LOAD MAIN PAGE</b></font><BR></center>’)};
<!– end hide –>
</script>

</center>

<!– Below are the links to the other pages –>

<center>
[ <a href=”javascript:parent.updatemain_order()”>Review Updated Order Form</a> ]
<br>
</center>

<P><HR Width=”60%”><P>

<!– Below are the shopping cart order items –>
<!– If you haven’t already looked, full instructions on –>
<!– converting these so you can use them are located in the tutorial and on –>
<!– pageone.htm –>

<!– This is named p3i1. That stands for Page Three, Item One –>

This Item Costs $5.55<P>
<input name=addbox type=button value=”Add This Item To My Order” onclick=Loc_additem(‘p3i1′,’5.55′,’Page_3_Item_1′,’pagethree.html’)><br>
<input type=button name=subbox value=”Subtract This Item From My Order” onclick=Loc_subitem(‘p3i1′,’5.55′,’Page_3_Item_1′,’pagethree.html’)><BR>
You Have Ordered This Many: <input type=text name=p3i1 size=2>

<P><HR Width=”60%”><P>

<!– This is named p3i2. That stands for Page Three, Item Two –>

This Item Costs $6.66<P>
<input name=addbox type=button value=”Add This Item To My Order” onclick=Loc_additem(‘p3i2′,’6.66′,’Page_3_Item_2′,’pagethree.html’)><br>
<input type=button name=subbox value=”Subtract This Item From My Order” onclick=Loc_subitem(‘p3i2′,’6.66′,’Page_3_Item_2′,’pagethree.html’)><BR>
You Have Ordered This Many: <input type=text name=p3i2 size=2>

<P><HR Width=”60%”><P>

<!– This is named p3i3. That stands for Page Three, Item Three –>

This Item Costs $7.77<P>
<input name=addbox type=button value=”Add This Item To My Order” onclick=Loc_additem(‘p3i3′,’7.77′,’Page_3_Item_3′,’pagethree.html’)><br>
<input type=button name=subbox value=”Subtract This Item From My Order” onclick=Loc_subitem(‘p3i3′,’7.77′,’Page_3_Item_3′,’pagethree.html’)><BR>
You Have Ordered This Many: <input type=text name=p3i3 size=2>

<P><HR Width=”60%”><P>

<!– Below are the links back to other pages pages –>

<center>
[ <a href=”javascript:parent.updatemain_order()”>Review updated Order Form</a> ]

<br>
</center>

</body>
</html>
[/code]

any help would be appreciated ?

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@lahmayesApr 04.2004 — i didnt get any errors on this script (IE6) but try enclosing your onClick contents (and any other input attributes) in quotes

onclick="Loc_additem('p3i1','5.55','Page_3_Item_1','pagethree.html')"
×

Success!

Help @adsolo spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...