This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 60810
    
  65

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: 30136
    
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
 
Similar Threads
Java Date to MySQL Date
Age
xslt sorting
Timer
date problem