Mobile Validation - B M SOLUTION
  • Mobile Validation

     <script type="text/javascript">

        function isNumberKey(evt) {

            var charCode = (evt.which) ? evt.which : event.keyCode

            if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57))

                return false;

            return true;

        }

    </script>


    <input type="text" name="mobileno" id="mobileno" class="form-control" pattern="[789][0-9]{9}" maxlength="10" onkeypress="return isNumberKey(event)"  />



    8630010048 - Right 

    86300 - Wrong 

    abc character not allow 

  • You might also like

    No comments :

    Post a Comment