<input oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(..*)./g, '$1');" class="form-control" id="phone" name="phone" type="text" placeholder="Phone"/>