function getValue2() { if (document.forms(0).aa<%=DOB.ClientID%>.value!="" && parseInt(document.forms(0).bb<%=DOB.ClientID%>.value.substring(0,4))>1900) { var d = new Date() var year_now=d.getYear(); var year_input=document.forms(0).bb.value.substring(0,4); var year=parseInt(year_now)-parseInt(year_input)+1; document.getElementById("lab").innerHTML="Age: " + year + " Years"; } var t =setTimeout('getValue2();',500); return; }
利用Javascript 重复不断监控控件动作
<SCRIPT language="javascript" type="text/javascript">
getValue2();
</SCRIPT>