Click here to Skip to main content
15,901,122 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to compare 2 input date in javascript.....if second date lesser it have to show
invalid....
Posted
Updated 12-Dec-12 23:08pm
v3

Comparing Dates 1

Comparing Dates 2


This two links will definately solve your issue....
 
Share this answer
 
http://jqueryui.com/datepicker/#date-range[^]

A solution with jquery, as described in jquery site http://jqueryui.com/datepicker/#date-range[] you can jquery range validator like-

XML
<script>
    $(function() {
        var dates = $( "#from, #to" ).datepicker({
            defaultDate: "+1w",
            changeMonth: true,
            numberOfMonths: 3,
            onSelect: function( selectedDate ) {
                var option = this.id == "from" ? "minDate" : "maxDate",
                    instance = $( this ).data( "datepicker" ),
                    date = $.datepicker.parseDate(
                        instance.settings.dateFormat ||
                        $.datepicker._defaults.dateFormat,
                        selectedDate, instance.settings );
                dates.not( this ).datepicker( "option", option, date );
            }
        });
    });
</script>
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900