This topic is locked

Date fields - year picks < 1954

6/21/2004 4:03:58 AM
ASPRunnerPro General questions
author

I've a date field into which a Date of Birth is entered. Currently however it has to be set as a text field, as when set to a date picker/drop down selection the year showing does not go lower than 1954 - the database requires DOB entries as far back as 1900. Any ideas on where/how I change this one?

Sergey Kornilov admin 6/26/2004

Stuart,
you can edit include/aspfunctions.asp file for this purpose. See my changes in bold:

Function WriteYears(d, f)

if f="" then

val=0

else

val=CInt(f)

end if

WriteYears = WriteYears & "<option value=""""> </option>"

for x=Year(d)-100 to Year(d)+50

if x=val then

  WriteYears = WriteYears & "<option value=" & x & " selected>" & x & "</option>"

else

  WriteYears = WriteYears & "<option value=" & x & ">" & x & "</option>"

end if

next

end Function


I hope this helps.