Click to See Complete Forum and Search --> : Subtract The Item From My Total


leecsone
07-22-2004, 09:04 PM
Hi all

I am working with a shopping cart. Now on the order form their are two texfield that has the price and the quinty. Can you help me add a button or a text that will Subtract The Item From My Total. Here is the script below.



if (parent.item_num > 0)
{

for (i =1;i < parent.item_num;i++)
{ if (parent.itemlist[i].quan > 0)
{index = index + 1;2;

document.write('<a href='+ parent.itemlist[i].url + '><i><b> review : </b></i></a> Price <input size=6 type=text name= ' + parent.itemlist[i].code + ' value=' + parent.itemlist[i].price + '> Quinty <input size=2 type=text name= ' + parent.itemlist[i].desc + ' value= '+ parent.itemlist[i].quan + '> <br>');

}
}
}


Thank You
leecsone
northrock.bm

PeOfEo
07-22-2004, 09:14 PM
Please do not tell me you are making a cart with java script.

leecsone
07-22-2004, 09:24 PM
HI yes. I do not understand how to use the other scripts like PHP.PL...

I am so lost do you know of a shopping cart that I can use.

Thank you for responding so soon
leecsone

PeOfEo
07-22-2004, 10:44 PM
Well you need to do it server side. You can use PHP CGI JSP ASP ASP.NET Cold Fusion, so on and so fourth. But a shopping cart is not a job for java script. The reason java script does not belong here is because a) it is not well supported, it is client side so it will not run for everyone b) it will not be secure if you intend to use it partially for the purchasing system c) it is not powerful and you cannot log stuff in a db with it, and I can keep going. Java script should be left to non essential aesthetics and making things more user friendly, while the functional scripting (the real neccessary stuff) is done by the server.

What server side languages are available to you? I know of a good asp.net one, but I do not know of the premade shopping carts for other language since I am an asp.net user.