美文网首页
2.绑定银行卡输入框格式[input]

2.绑定银行卡输入框格式[input]

作者: 一枼落知天下 | 来源:发表于2019-08-14 12:05 被阅读0次

前端

<input name="bankcard" id="edit_bankcard" onkeyup="this.value=this.value.replace(/\D/g,'').replace(/....(?!$)/g,'$& ')" class="bank_add_cardnum" type="text" placeholder="只能绑定认证用户本人的银行卡">
           

后端

$bankcard = str_replace(' ', '', $bankcard);
if (strlen($bankcard) < 12) die('请检查银行卡卡号');

最终效果:

相关文章

网友评论

      本文标题:2.绑定银行卡输入框格式[input]

      本文链接:https://www.haomeiwen.com/subject/bnhgjctx.html