Update the qty fields on input change without click
-
At the moment, if I update my quantity field on the product page, say changing the quantity from 1 to 2, I am required to then mouse click anywhere on the screen in order to see the updated amount of #{n} fields.
If I use up and down keypress it is instant, I know this seems minor but it would be great UX if the #{n} fields updated half a second after you change the input field number, without requiring a click or enter press.
Is there a function I can fire to updated the product fields? I have this code below that will fire code with a delay upon input change, but I need a means to trigger the #{n} fields update myself.
var timeout;
function updateConfigurationFields() {
$(‘.single-product input.qty’).on(‘input’, function(){if ( timeout !== undefined ) {
clearTimeout( timeout );
}timeout = setTimeout(function() {
// do stuff
}, 500 );});
}
updateConfigurationFields();
- The topic ‘Update the qty fields on input change without click’ is closed to new replies.