Thread: Age Calculation
View Single Post
  #3 (permalink)  
Old May 9th, 2006, 00:35
ekendricks ekendricks is offline
Junior Member
Join Date: Aug 2003
Location: USA
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Age Calculation

Thanks for the response.....Not exactly what I'm looking for. What I need is something on the order of the script below.

---------------------------------------------------------

<script language="JavaScript">
function age() {

var DOB = (document.Dui.DOB.value);
var DateWritten = (document.Dui.DateWritten.value);

If Month(DateWritten) < Month(DOB) Or (Month(DateWritten) = _
Month(DOB) And Day(DateWritten) < Day(DOB)) Then
document.Dui.Age.value = Year(DateWritten) - Year(DOB) - 1
Else
document.Dui.Age.value = Year(DateWritten) - Year(DOB)
End If
End Function
}
</script>
---------------------------------------------------------------

When I run the above script, I get no results: "Error on page".

Thanks

Ernest

Last edited by ekendricks; May 9th, 2006 at 00:41.
Reply With Quote