File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Manage Date of Birth dynamically in javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Manage Date of Birth dynamically in javascript" Watch "Manage Date of Birth dynamically in javascript" New topic
Author

Manage Date of Birth dynamically in javascript

Omkar G. Deshmukh
Ranch Hand

Joined: Sep 21, 2012
Posts: 41
Hi Team,

i ma designing on form in jsp. in that i am having one feild Date of Birth in that i want three drop down boxes one for month another for day and last for year.

i dont want to hardcode this details in my jsp file.beacause it will make my code lenghty... so kindly give me the solution for this.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61190
    
  66

Why not join the modern era and use a date-picker rather than three dropdowns?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30506
    
150

You could use a loop. Even better you could create a "model" object in your servlet that has logic to create that list. Then the JSP refers to that in a loop.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Omkar G. Deshmukh
Ranch Hand

Joined: Sep 21, 2012
Posts: 41
hi team,

i used javascipt for this in that i used for loop.
then i created element for each iteration.

Thanks.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Manage Date of Birth dynamically in javascript