<HTML>
<HEAD>
<title>根据身份证号码获取性别、出生日期、籍贯省、籍贯市、籍贯区县</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="javascript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
<script type="text/javascript" src="GetInfoFromIdcard.js" charset="GB2312"></script>
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<table >
<tr><td align="left">身份证号码<input type="text" id="_idcard" />
<br/>性别<input type="text" id="_sex"/>
<br/>出生日期<input type="text" id="_birthday"/>
<br/>籍贯省<input type="text" id="_province"/>
<br/>籍贯市<input type="text" id="_city"/>
<br />籍贯区县<input type="text" id="_county"/>
<select id="ctl00_PageBody_XB_Input">
<option value="男">男</option>
<option value="女">女</option>
</select>
</td></tr>
</table>
</form>
<script language="javascript">
/**
* get_info_from_idcard_extension(_idcard,_sex,_birthday,_province,_city,_county);
* 根据身份证号码获取性别,出生日期,籍贯省,籍贯市,籍贯县
* 参数1,_idcard,输入的证件号码,必须输入的项目
* 参数2,_sex,性别页面元素id,可选项。该参数不为空,则将结果赋值给该id对应的元素;不需要获取性别,该参数为''
* 参数3,_birthday,出生日期页面元素id,可选项。该参数不为空,则将结果赋值给该id对应的元素;不需要获取出生日期,该参数为''
* 参数4,_province,籍贯省页面元素id,可选项。该参数不为空,则将结果赋值给该id对应的元素;不需要获取籍贯省,该参数为''
* 参数5,_city,籍贯市页面元素id,可选项。该参数不为空,则将结果赋值给该id对应的元素;不需要获取籍贯市,该参数为''
* 参数6,_county,籍贯县页面元素id,可选项。该参数不为空,则将结果赋值给该id对应的元素;不需要获取籍贯县,该参数为''
* 使用方法,参数一为身份证号码,其它参数为可选项
* 如只获取性别,get_info_from_idcard('_idcard','_sex','','','','');
* 如同时获取性别、出生日期,get_info_from_idcard('_idcard','_sex','_birthday','','','');
* 如同时获取性别、出生日期、籍贯省、籍贯市、籍贯县,get_info_from_idcard_extension('_idcard','_sex','_birthday','_province','_city','_county');
*/
document.getElementById('_idcard').onchange = function (event)
{
get_info_from_idcard_extension(event,this,'_idcard','_sex','_birthday','_province','_city','_county');//设置文本框的值
select_choose_by_text('ctl00_PageBody_XB_Input','_idcard');//设置下拉框的选定项,参数1,ctl00_PageBody_XB_Input,性别下拉框id;参数2,_idcard,身份证文本框id
};
</script>
</body>
</HTML>
- 1
- 2
- 3
- 4
- 5
前往页