Populate Date Forms

Hi,

Im currenly writing a JSP page that includes a form where a user can select Year,Month,Day etc. For the year part I would like to instead of hardcoding 2005,2006,2007, etc a function to do this. I.e first option = current year.

And I would also like to use the window.onLoad to get this to show when page is loaded but unable to get it working.

Any help is appreciated

[398 byte] By [Lunnya] at [2007-10-2 20:32:28]
# 1
Take a look at the GregorianCalendar class, you can easily find the current year using it.As for your onLoad problem: it's most likely a javascript issue, so use Firefox and it's brilliant javascript console to check for errors.
gimbal2a at 2007-7-13 23:15:37 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Aye I know how to get current year but lets say I save this value to a variable how do i pass it to the form ? So that first option is current year
Lunnya at 2007-7-13 23:15:37 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...