hi i have a problem with age Updating, when i click the calendar the age textbox will autofill point to current date and it's working properly, but the problem when i test to change the Year on the System/Control Panel on my computer, the age not change automatically....i wondering how could it be......anyone can help...thxx
here's my code for calendar and age :
<script LANGUAGE="vbSCript">
sub window_onload()
end sub
Sub GetDate(objMe,x,y)
strThisElement = objMe.getattribute("IndexVal")
x= x & "px"
retVal = window.showModalDialog ("../../Calendar2/calDraw1.asp?Locale=Set""0","0","dialogWidth:248px;dialogHeight:208px;dialogleft:"& x &";dialogtop:"& y &";status: no;unadorned: yes;help: no;scroll:no")
If retVal <> "" Then
document.all(strThisElement).value = retVal
dateofbirth = document.frmQuery.DateOfBirth.value
age = round(datediff("m",dateofbirth,now)/12)
if datepart("m",dateofbirth) > datepart("m",now) then
document.frmQuery.Age.value = age - 1
else
document.frmQuery.Age.value = age
end if
End If
End Sub
</script>





thx.....sorry make you confused....

Bookmarks