<div class="row">
<div class="col-md-6 offset-md-3">
<input type="text" class="form-control"
placeholder="Enter Contact No. Only"
name="phone" id="phone" autocomplete="off" required>
</div>
</div>
<script type="text/javascript">
$("input[name=phone]").attr("maxlength", "10");
$('#phone').keypress(function(e) {
//if the letter is not digit then display
error and don't type anything
if (e.which != 8 && e.which != 0 &&
(e.which < 48 || e.which > 57)) {
//display error message
//$("#errmsg").html("Digits Only").show().
fadeOut("slow");
return false;
}
});
</script>
Code run perfectly.
Any issue contact me
No comments:
Post a Comment