Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

jquery only number allowed to 10 digit

<script type="text/javascript">
  $(document).ready(function() {	
  $("#phone_work").attr("maxlength", "10");
  $("#phone_work").keypress(function(e) {
    var kk = e.which;
    if(kk < 48 || kk > 57)
      e.preventDefault();
  });
});
</script>
 
PREVIOUS NEXT
Tagged: #jquery #number #allowed #digit
ADD COMMENT
Topic
Name
2+1 =