Ok, ive nearly got it! It now gives an error when I enter a negative number or a letter in the quantities box, which is correct. But when I put a valid entry in, ie a positive number, it empties the cart. This is the code im using:
var justValidating = true
function validateForm(f){
var val =...