Answers for "input type text maxlength validation for number onlyy"

-1

input type number maxlength

<input type="text" pattern="\d*" maxlength="4">
Posted by: Guest on December-23-2021
0

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 "input type text maxlength validation for number onlyy"

Browse Popular Code Answers by Language