国家代码手机

表单中常用的国家-手机输入框:GitHub:https://github.com/jackocnr/intl-tel-input

<div class="form-group user">
        <label class="col-sm-2 control-label">手机号</label>
        <div class="col-sm-6">
        <input type="tel" id="demo" placeholder="" class="form-control" name="country_phone" value="{{ $user->country_phone }}">                                </div>
    </div>

引入一个css和js

<script src="{{ asset('js/plugins/intl-tel-input-master/build/js/intlTelInput.js') }}"></script>
<link href="{{ asset('css/plugins/intl-tel-input-master/build/css/intlTelInput.css') }}" rel="stylesheet" >

初始化

$("#demo").intlTelInput({
    //优先显示
    preferredCountries: [  "cn","de" ],
});

效果图 http://www.jq22.com/jquery-info12917

最后修改:2019-08-20 03:08:58
0