Search
 
SCRIPT & CODE EXAMPLE
 

HTML

input number maxlength

<form method="post">
      <label for="myNumber">My Number:</label>
      <input type="number" maxlength="9" required
      oninput="javascript: if (this.value.length > this.maxLength) this.value = this.value.slice(0, this.maxLength);" >
     <br><br>
      <input type="submit" value="Submit">
</form>
Comment

input number maxlength html

<input name="var"
    oninput="javascript: if (this.value.length > this.maxLength) this.value = this.value.slice(0, this.maxLength);"
    type = "number"
    maxlength = "6"
 />
Comment

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);
   }       
 }); 
});
Comment

PREVIOUS NEXT
Code Example
Html :: non breaking space html 
Html :: vuejs double click 
Html :: vue datatable date format 
Html :: horizontal line html react 
Html :: html display only on desktop 
Html :: flexbox bootstrap 4 
Html :: html accept png and jpg 
Html :: css textarea limit 
Html :: bootstrap 5 align middle 
Html :: start html 
Html :: justify-content-center react bootstrap 
Html :: html image googe drive 
Html :: add tab icon html 
Html :: indian phone pattern regex 
Html :: html center button 
Html :: html links 
Html :: allow only positive integer in input type number 
Html :: include favicon into website 
Html :: routerlink forward ionic 
Html :: laravel csrf fields 
Html :: bootstrap 5 datalist example 
Html :: share link to email 
Html :: how to get value of textbox in javascript from html 
Html :: modal footer button center 
Html :: bootstrap 4 search bar 
Html :: how to make a alert in powershell 
Html :: magento 2 call phtml file in cms page 
Html :: how to make dropdown in html 
Html :: html close window button 
Html :: input cursor color 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =