Answers for "jquery change input value if greater than"

0

jquery change input value if greater than

jQuery("input[type='text'][name='quantity']").change(function() {
    if (parseInt($(this).val(),10) > 40) {
        alert("To order quantity greater than 40 please use the contact form.");
        this.value == '';
        /* or with jQuery: $(this).val(''); */
        $(this).focus();
        return false;
    }
});
Posted by: Guest on August-05-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language