Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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;
    }
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: discord js on message 
Javascript :: prime number js 
Javascript :: get date now javascript 
Javascript :: javascript backslash 
Javascript :: uncaught TypeError: $.jajax is not a function 
Javascript :: duplicates array js 
Javascript :: check scroll top height in react js 
Javascript :: lodash convert object to array 
Javascript :: javascript check if array has duplicates 
Javascript :: how to parse using express without body parser 
Javascript :: jquery array remove element 
Javascript :: Cast to ObjectId failed for value 
Javascript :: ERESOLVE unable to resolve dependency tree Found: react@17.0.2 Could not resolve dependency: react native paper 
Javascript :: any click event jquery 
Javascript :: getx arguments 
Javascript :: get placeholder innerhtml 
Javascript :: javascript class constructor 
Javascript :: get first element by class name jquery 
Javascript :: discord.js guildMemberAdd 
Javascript :: jquery ajax 500 error handling 
Javascript :: how to use secondary color in material ui useStyle 
Javascript :: lexical scoping javascript 
Javascript :: react run useeffect only once 
Javascript :: jquery add style background-image 
Javascript :: mongoose virtuals 
Javascript :: check if an array is empty javascript 
Javascript :: how to find the smallest two numbers in an array javascript 
Javascript :: js onload 
Javascript :: node js server get images from folder 
Javascript :: axios x-api-key for all 
ADD CONTENT
Topic
Content
Source link
Name
1+2 =