Link to home
Start Free TrialLog in
Avatar of impressionexpress
impressionexpress

asked on

Validate date using jquery

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());

Open in new window


Thanks in advance for your help
ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial