troubleshooting Question

Validate date using jquery

Avatar of impressionexpress
impressionexpress asked on
jQuery
1 Comment1 Solution72 ViewsLast Modified:
I have a date picker that enters the selected date inside the textbox. I need to make sure of the following before I save the date:

Make sure the field is not empty
Make sure the date is in YYYY-MM-DD format (ready to store in mysql date type column)
Make sure the date is at least 18yrs ago

				//Last Name
				var input= $("#last_name");
				var last_name = input.val();
				if(last_name != "" && validate_letters_only(last_name)){
					fd.append('last_name', last_name);
					input.removeClass("invalid").addClass("valid");
				}else{
					input.removeClass("valid").addClass("invalid");
				}
				
				// Birthday
				fd.append('birthdate', $("#birthday").val());

Thanks in advance for your help
ASKER CERTIFIED SOLUTION
leakim971
Multitechnician
Join our community to see this answer!
Unlock 1 Answer and 1 Comment.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros