I just want to let you know what I did to prevent the error when deleting the quantity and click on "add to cart", so the user not get the error: the input string was not in correct format: http://starterkit.teacommerce.dk/en/products/category-a.aspx
and the same in productList_product.xslt just without id="qunatity".. then if the user tries to remove the quantity, it just use 1 as standard quantity and you will not get the error message..
Yes, it just set the value to 1 when the value is 1, but it isn't something the eye will notice.. I'm not sure if the browser will do any changes or it doesn't do anything when the value is 1.
or you could set it to an empty string on click: onfocus="if (this.value == '1') {{ this.value = ' '; }}" .. but that only works when the value is 1.. so I think you'll have to make a variable with the current value, and use that instead of 1. So it also works with 2, 3, 4 and so on.. But in my case I just want to keep the number in the textbox :)
Quantities of a product
Hi guys
I just want to let you know what I did to prevent the error when deleting the quantity and click on "add to cart", so the user not get the error: the input string was not in correct format: http://starterkit.teacommerce.dk/en/products/category-a.aspx
I have changed this in product_product.xslt:
to:
and the same in productList_product.xslt just without id="qunatity"..
then if the user tries to remove the quantity, it just use 1 as standard quantity and you will not get the error message..
just a quick fix on the problem :)
Bjarne
Hi Bjarne
Great info - just to further exhance your code - I think that the onfocus method doesnt do anything. If value = 1 then set value = 1 :)
Kind regards
Anders
Hi Anders
Yes, it just set the value to 1 when the value is 1, but it isn't something the eye will notice.. I'm not sure if the browser will do any changes or it doesn't do anything when the value is 1.
or you could set it to an empty string on click: onfocus="if (this.value == '1') {{ this.value = ' '; }}" .. but that only works when the value is 1.. so I think you'll have to make a variable with the current value, and use that instead of 1. So it also works with 2, 3, 4 and so on..
But in my case I just want to keep the number in the textbox :)
Bjarne
is working on a reply...