Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

input type number max value validation

/* comman function for all input by joshi yogesh {joshiyogesh0333@gmail.com} */

$(function () {
   $( "input" ).change(function() {
   var max = parseInt($(this).attr('max'));
   var min = parseInt($(this).attr('min'));
   if ($(this).val() > max)
   {
      $(this).val(max);
   }
   else if ($(this).val() < min)
   {
      $(this).val(min);
   }       
 }); 
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #input #type #number #max #validation
ADD COMMENT
Topic
Name
6+5 =