Answers for "set maxlength for input type number"

1

input max length

<input maxlength="10" />
Posted by: Guest on October-02-2020
1

input type number max value validation

/* comman function for all input by joshi yogesh {[email protected]} */

$(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);
   }       
 }); 
});
Posted by: Guest on January-24-2021

Code answers related to "set maxlength for input type number"

Browse Popular Code Answers by Language