Here is the quick article about to validate end date should be greater than start date using jQuery.Most of time when we use date range, we always need to validate two dates.
[sociallocker]
Well, I am going to show simple example which is very easy for you to use.Let’s see the below code:
1 2 3 4 5 6 7 8 | $.validator.addMethod("enddate", function(value, element){ var startdatevalue = $('.startdate').val(); return Date.parse(startdatevalue) <= Date.parse(value); }, 'End Date should be greater than equal to Start Date.'); }); |
That’s it. I hope above function will useful to you.
As always, thanks for reading. Don’t Forget to Follow us on Twitter or Subscribe us to Get the Latest Updates.[/sociallocker]
Comments (2)