View Single Post
Old 03-04-2007, 11:29 AM  
Quickdraw
Confirmed User
 
Join Date: Mar 2004
Location: → → →
Posts: 1,717
Quote:
if(document.cookie && document.cookie != ""){
var old_cookie = document.cookie;
var new_value = document.form.quantity.value;
var new_cookie = old_cookie + new_cookie;
A note on the above-- it appears to have new_value as what is in the form, but when adding the old_cookie to new_cookie, in "var new_cookie", it isn't used.

Anyway, as far as adding those digits, you can either multiply each by one, or use the Number function.
var new_cookie = old_cookie * 1 + new_value * 1;
or
var new_cookie = Number(old_cookie) + Number(new_value);

Good luck
Quickdraw is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote