Posted on : 2019-08-02 00:59:21 View Type: public
Vaibhav Dixit

Hello Team,
We want to add jquery validation in custom html mobile no field . but this code is not support on browser and mobile application.
code:-
<div class="form-group">
<input id="phone" class="form-control input-lg" name="phone" required="" style="margin:10px 10px 10px 0px;" maxlength="15" minlength="10" onkeypress="return isNumber(event)" type="text" placeholder="OTP Phone No." />
<script type="text/javascript">
function isNumber(evt) {
evt = (evt) ? evt : window.event;
var charCode = (evt.which) ? evt.which : evt.keyCode;
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
alert("Please enter only Numbers.");
return false;
}
return true;
}
</script>
Looking forward to your reply,
Thanks!
</div>