• Post Reply Bookmark Topic Watch Topic
  • New Topic

calendar box

 
Raj Ohadi
Ranch Hand
Posts: 316
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
facing an interesting problem --- In a JSP page I need customer to enter an expected delivery date. Basically I can let them enter digits in the format of "MM/DD/YY" or "MM/DD/YYYY" and I can validate the input. But, how do I know if this date he entered is a REAL date ? for example, 02/29/2008 is valid but 02/29/2007 is not ! It is hard to include so much logics in my validation code ! So, how can I put a calendar icon there and let user click it and click a date on that popped up calendar ? I think Bank of America has that interface as I am using it.. Don't know how to implement that in a JSP ? any resource and suggestion from somebody who has done that ?

Thank you.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are plenty of Javascript calendars out there.
A Google search should make it easy to find them.

Regardless of which one you use, you will still need to validate the date on the server if it is important that you get a valid one.
Never trust data coming from the web.
 
Raj Ohadi
Ranch Hand
Posts: 316
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ben Souther:
There are plenty of Javascript calendars out there.
A Google search should make it easy to find them.

Regardless of which one you use, you will still need to validate the date on the server if it is important that you get a valid one.
Never trust data coming from the web.


how do you validate date from server ? can you be more specific ?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you familiar with the Java date and calendar classes?
 
dhwani mathur
Ranch Hand
Posts: 621
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi thr

i think if this could help you to some extent

java script calender
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by dhwani mathur:
Hi thr
Please use real words when posting to the forums. Abbreviations such as "thr" in place of "there" only serve to make your posts more difficult to read and less likely to generate useful responses.

Please read this for more information.

thanks,
bear
JavaRanch sheriff
 
dhwani mathur
Ranch Hand
Posts: 621
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!!


I sincerely apologize for the above !!




Dhwani:>Winning is not important but it is the only thing.
 
Sripathi Krishnamurthy
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Raj,
there are 2 options for you. First, you can use client side validation which will be a Javascript. Second option is server side validation. If you application development standard allows you to use Javascript, nothing better than that.

Check this out..
http://www.blueshoes.org/_bsJavascript/components/datepicker/examples/example1.html
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Sripathi Krishnamurthy:
there are 2 options for you. First, you can use client side validation which will be a Javascript. Second option is server side validation. If you application development standard allows you to use Javascript, nothing better than that.

I completely disagree. Client side validation can be used to make things nice for the user, but it should never be relied upon. Data must always be validated on the server regardless of whether client-side validation was used or not.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!