Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 753
  • Last Modified:

How to validate a Date field with JQuery

Hi Experts,
I am a Jquery newbie.  I am making a webpage where I am using date picker in Jquery to supply the calender for two input fields. I want to validate the date after the selection is done or the user types a date on his own.
Also the first input field is checkin and the second one is check out. So I need also make sure that they can't select the same date in the check out field as they do in check in date
can you please  help me figure this out?
Thanks in advance guys
0
guyneo
Asked:
guyneo
  • 4
  • 3
2 Solutions
 
Gurvinder Pal SinghCommented:
you need to parse the date into the date object and then check for equality (assuming that both dates are in different format, else just a if condition will suffice)
use Datejs for doing parsing
http://www.datejs.com/
0
 
Samuel LiewCommented:
Please post a link to your page.
0
 
guyneoAuthor Commented:
@gurvinder I will give it a try. I am wondering if Jquery validate plugin will be able to do this with ease?
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Samuel LiewCommented:
I don't mean to be rude, but the more information you provide to us regarding your problem the faster you will receive a solution that you can implement quickly, rather than having everyone to guess (or even skip over) your question. If you had provided your page code, somebody might have already coded the solution for you.

Regards
0
 
guyneoAuthor Commented:
No offense taken Sam. What you say is right.
However the developement machine and hence the webpage is not accesible from outside. So I can't post the link. I can post the relevant part of the form if that would help to get an idea of what I need.  It is a basic book/document library application   The webpage I am trying to validate is pretty simple. Regular Date fields: One field for checkOut and One for CheckIn.
0
 
Samuel LiewCommented:
Okay. What is the format of the date you are trying to validate? DD/MM/YY?
0
 
guyneoAuthor Commented:
Yes. or   DD/MM/YYYY
0
 
Samuel LiewCommented:
You could do something like this
foo50---Validate-DatePicker.html
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now