how to validate mobile number in html form
<div>
<label for="phone">Enter your phone number:</label>
<input type="tel" id="phone" name="phone" pattern="+94[7-9]{2}-[0-9]{3}-[0-9]{4}" value="+94">
</div>
how to validate mobile number in html form
<div>
<label for="phone">Enter your phone number:</label>
<input type="tel" id="phone" name="phone" pattern="+94[7-9]{2}-[0-9]{3}-[0-9]{4}" value="+94">
</div>
html textbox pattern mobile number
<input type="text" name="Phone Number" pattern="[7-9]{1}[0-9]{9}"
title="Phone number with 7-9 and remaing 9 digit with 0-9">
input type for contact no
label for="phone">Enter your phone number:</label>
<input type="tel" id="phone" name="phone" pattern="[0-9]{3}-[0-9]{2}-[0-9]{3}">
phone number input
JS Libraries required :
======================
https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js
https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/8.4.7/js/intlTelInput.js
Inside JS File :
================
$("input").intlTelInput({
utilsScript: "https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/8.4.6/js/utils.js"
});
Inside HTML File :
===================
<h1>International Telephone Input - BOOTSTRAP INPUT GROUP</h1>
<form>
<div class="input-group">
<input type="tel" class="form-control">
<span class="input-group-addon">Tel</span>
</div>
<br>
<div class="input-group">
<input type="tel" class="form-control">
<span class="input-group-addon">Tel</span>
</div>
</form>
Inside Css File :
=================
body {
margin: 20px;
}
form {
width: 300px;
}
// workaround
.intl-tel-input {
display: table-cell;
}
.intl-tel-input .selected-flag {
z-index: 4;
}
.intl-tel-input .country-list {
z-index: 5;
}
.input-group .intl-tel-input .form-control {
border-top-left-radius: 4px;
border-top-right-radius: 0;
border-bottom-left-radius: 4px;
border-bottom-right-radius: 0;
}
tel pattern
<form>
<div>
<label for="country">Choose your country:</label>
<select id="country" name="country">
<option>UK</option>
<option selected>US</option>
<option>Germany</option>
</select>
</div>
<div>
<p>Enter your telephone number: </p>
<span class="areaDiv">
<input id="areaNo" name="areaNo" type="tel" required
placeholder="Area code" pattern="[0-9]{3}"
aria-label="Area code">
<span class="validity"></span>
</span>
<span class="number1Div">
<input id="number1" name="number1" type="tel" required
placeholder="First part" pattern="[0-9]{3}"
aria-label="First part of number">
<span class="validity"></span>
</span>
<span class="number2Div">
<input id="number2" name="number2" type="tel" required
placeholder="Second part" pattern="[0-9]{4}"
aria-label="Second part of number">
<span class="validity"></span>
</span>
</div>
<div>
<button>Submit</button>
</div>
</form>
input telefono html
<form name="ejemplo1" action="15-html5-tel-input-demo2.php" method="POST">
Introduce tu TELEFONO con los 9 dígitos: <input type="tel" name="telefono" pattern="[0-9]{9}">
<input type="submit" value="Enviar">
</form>
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us