Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Validate quantity entered into shopping cart


mike88

Recommended Posts

Posted

We have discovered that users can type non-numeric characters into the quantity box for the shopping cart.

 

For instance if the quantity is set to 1 currently, the user would like to make it 10 but mistakenly typed an 'o' instead of a zero, it will happily accept the '1o' and treat the quantity as 1, likewise if someone typed 2w, it will be treated as 2. But if the quantity did not start with a number, it will be treated as a zero.

 

Is there any fix for this or do we have to write our own validation module?

Posted

you could add a jscript to the form for validation. Just use the parseInt function to check if the entry is a number and greater than 0.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...