Meaningless Drivel is fun!*
The moose likes JSP and the fly likes Populating select box with dates Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Populating select box with dates" Watch "Populating select box with dates" New topic
Author

Populating select box with dates

Dilip kumar
Ranch Hand

Joined: Oct 16, 2000
Posts: 360
Hi,

In my JSP page I need to populate the Ship Date drop-down box with last 30 dates in the format 11/08/2004, 11/07/2004, 11/06/2004.... I'm running out of ideas. I really appreciate anu suggestions.

I'm stuck at this point...



Thanks much.
ernest fakudze
Ranch Hand

Joined: Aug 27, 2001
Posts: 216
Hi Dilip,

You need to use the caledar class to do this. Please see some code I've just written for you below.



In a time of drastic change it is the learners who inherit the future. The learned usually find themselves equipped to live in a world that no longer exists.<br />Eric Hoffer
Dilip kumar
Ranch Hand

Joined: Oct 16, 2000
Posts: 360
Thanks a million for your time. It worked !!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Populating select box with dates
 
Similar Threads
string comparison with EL / JSTL
MAKING A DROP DOWN SELECTION
Passing a date
Having trouble with javascript ...
Help wanted on control select/option by javascript