怎么在文本框中输入身份证中获取出生年月与性别
怎样在文本框中输入身份证中获取出生年月与性别?
想用asp做一个 页面 输入身份证 点击确定再另外两个文本框中得到出生日期和性别 。刚学习 asp有点菜。求高手帮助解决 ,谢谢 !
------解决思路----------------------
想用asp做一个 页面 输入身份证 点击确定再另外两个文本框中得到出生日期和性别 。刚学习 asp有点菜。求高手帮助解决 ,谢谢 !
------解决思路----------------------
<input id="a"/>
<input type="button" id="btn" value="get"/>
<input id="b"/>
<input id="c"/>
<script>
document.getElementById('btn').onclick=function(){
var v=document.getElementById('a').value;
//****************验证
document.getElementById('b').value=v.replace(/^\d{6}(\d{4})(\d{2})(\d{2}).+/,'$1-$2-$3');
document.getElementById('c').value=parseInt(v[16])%2?'男':'女'
}
</script>