十万火急求大哥帮忙
为道不欲多 2013-10-13 07:38:44 身份证号码:
<s:textfield name="" id="recommenderIdcardNo" onblur="showbirthdate();">
</s:textfield>
生日:
<s:textfield name="account.birthdate" cssClass="readonly" id="accountBirthday"></s:textfield>
如上 两个struts标签 我想写个js当我在身份证号框中输入身份证号 失去焦点时生日框中自动根据身份证号生成生日并在生日框中显示出来
我写的js:
function showbirthdate(){
var idcardNo = $("#recommenderIdcardNo").val();
$("#accountBirthday").val=idcardNo.substring(5,13);
document.getElementById("accountBirthday").val=idcardNo.substring(5,13);
alert(idcardNo.substring(5,13));
}
但不行 生日框里不显示 哪里错了?
高手帮忙指点下 非常感谢了