I have a form with loads of INPUT fields in a grid SIZE / COLOUR. I want the form to submit each time a number is entered into an INPUT FIELD - as it dynamically calculates prices.
At the moment this works:
$('.myval').bind('keyup', function() {
if($(this).val().length >= 2) {
$('#cart').submit();
}
});
But as you can see it needs on 2 characters before firing the form.
I need it to be able to fire on 1,2 or 3 characters (so like Qty 4 , qty 56, qty 657). So I guess it needs 'Wait' for a few milliseconds to 'see' if another key is pressed and then wait again to see if a third key is pressed.
Can anyone help with this?