• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to validate date from a drop down box to mysql using jsp and servlets  RSS feed

 
sunaina agarwal
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hello , am trying to validate a registration form.. i have been able to validate everything on my form except date below is my code please have a look and kindly help me fix it.

Kindly someone help me asap..



and my drop down list for date in html goes like this























 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37496
547
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds like your question is how to implement this method.

First, remember not to use == for String comparison in Java.

For validation, think about what your requirements are. Do you want a certain format of date? A certain range of dates?

The SimpleDateFormat class may help you validate format if you can express what format is allowed.
 
sunaina agarwal
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you Jeanne Boyarsky
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!