http://edfuture.mooc.ca/cgi-bin/login.cgi $(function(){ window.prettyPrint && prettyPrint(); $('#dp1').datepicker({ format: 'mm-dd-yyyy' }); $('#dp2').datepicker(); $('#dp3').datepicker(); var startDate = new Date(2012,1,20); var endDate = new Date(2012,1,25); $('#dp4').datepicker() .on('changeDate', function(ev){ if (ev.date.valueOf() > endDate.valueOf()){ $('#alert').show().find('strong').text('The start date can not be greater then the end date'); } else { $('#alert').hide(); startDate = new Date(ev.date); $('#startDate').text($('#dp4').data('date')); } $('#dp4').datepicker('hide'); }); $('#dp5').datepicker() .on('changeDate', function(ev){ if (ev.date.valueOf() < startDate.valueOf()){ $('#alert').show().find('strong').text('The end date can not be less then the start date'); } else { $('#alert').hide(); endDate = new Date(ev.date); $('#endDate').text($('#dp5').data('date')); } $('#dp5').datepicker('hide'); }); });

Welcome to You are using this site anonymously and will be identified as 'Anymouse' if you choose to post comments.

If you wish to sign your name to comments or to receive a newsletter by email, you will need to login or register.