Answers for "input type=number'' maxlength validation javascript"

8

how to specify amout of letters in inputfield in css

<input maxlength="25" placeholder="name" />
Posted by: Guest on April-15-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 "input type=number'' maxlength validation javascript"

Browse Popular Code Answers by Language