Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

allow only integer or float in text fields jQuery

$(function(){
      
  $('.number-only').keyup(function(e) {
        if(this.value!='-')
          while(isNaN(this.value))
            this.value = this.value.split('').reverse().join('').replace(/[D]/i,'')
                                   .split('').reverse().join('');
    })
    .on("cut copy paste",function(e){
    	e.preventDefault();
    });

});
Comment

PREVIOUS NEXT
Code Example
Javascript :: open html file in browser using package.json 
Javascript :: how to draw horizontal line in canvas 
Javascript :: get method 
Javascript :: jquery datepicker change date format 
Javascript :: mongoose unique 
Javascript :: trigger on change 
Javascript :: add font awesome to vue 
Javascript :: TypeError: value.toLowerCase is not a function 
Javascript :: javascript current time 
Javascript :: apache angular routing 
Javascript :: jquery bind function to multiple events 
Javascript :: jquery radio button checked event 
Javascript :: how to save data i mongi db 
Javascript :: Material App debug mode 
Javascript :: datatables typeerror k is undefined 
Javascript :: electron hot model reload 
Javascript :: on modal close jquery 
Javascript :: js is prime 
Javascript :: javascript date 3 months ago 
Javascript :: react native run on specific emulator 
Javascript :: jquery get link href value 
Javascript :: js pixelated 
Javascript :: Codewars hello world 
Javascript :: remove floating point javascript 
Javascript :: visual code put quotes to each line 
Javascript :: google apps script moment js 
Javascript :: onclick focus out jquery 
Javascript :: javascript get boundary client rect 
Javascript :: how to create hyperlinks discord.js 
Javascript :: remove all chars from string and leave only numbers javascript 
ADD CONTENT
Topic
Content
Source link
Name
1+6 =