Hi,
I am developing a e-commerce website where i ahve something like 4000 products which all have a product code. I am using this product code as the unique reference on the webpage to add the product to the cart.
these are the basic elements of the form:
<!--- the quantity field for a specific product--->
<input type="text "name="quantiy10001" value="1">
<!--- the submit button next to the product --->
<a href="javascript:submitMe('#getProducts.ProductCode#');" class="link">Add Product</A>
<!--- this is the code that i am having problems with --->
function submitMe(PCode) {
var a,b,c,d
a = 'document.cart.quantity' + PCode + '.value';
b = eval(a);
}
This code above works fine when i have a product code as above (10010) but some of the product codes are of the format 10010/FF so when i come to the eval(a) line it tries to divide 10010 by FF and produces an error.
What i need is for the actualt quantity entered into the field to be returned can anyone suggest anything that i could do to either cancel out the / in the product code or another function that is not going to try and do a mathematical function on it ?
cheers !
tony