/    Sign up×
Community /Pin to ProfileBookmark

Hi,
This is my first post in here so a big hello to you all.I need a little help with javascript on a webpage that i am creating and being a newbie I am totally stuck. I am trying to modify this little cart example

[url]http://www.jsworkshop.com/js13/list23-1.html[/url]

so that if the user adds the same item twice then it updates the total; rather than just adding another underneath the first one. Secondly how would i go about adding a reset button to empty the cart. Any advice would be appreciated. :p

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@AdamGundryMar 18.2003 — I've finished the modifications you asked for, you can view the modified script at this address:

http://www.agbs.co.uk/dev/ozz/list23-1.html

You will need to download the following files:

http://www.agbs.co.uk/dev/ozz/list23-1.html

http://www.agbs.co.uk/dev/ozz/products.html

http://www.agbs.co.uk/dev/ozz/cart_complete.html

http://www.agbs.co.uk/dev/ozz/fsclogo.gif

I suggest you modify the form in cart_complete.html to submit to an email address or your form-to-mail script.

Good luck

Adam
Copy linkTweet thisAlerts:
@ozzauthorMar 19.2003 — Thanks a lot, you have managed to do exactly what i needed. Appreciate it.

Thanks again.?
×

Success!

Help @ozz 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.18,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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