asked on August 19, 2014
Hi everyone,
I've used the code provided by Eric on this question and modified to do what I need, which is compare 2 different date fields.
However, the 'warning' part of the code doesn't seem to work and I've tested it within IE and Chrome. We'd need a pop up alert letting them know why the form is not submitted.
This is the code I'm using:
$(document).ready(function () {
var d1 = new Date();
var d2 = new Date();
$('.date2').change(function () {
if ($('.date1 input').val() == $('.date2 input').val()) {
if ($('.ageWarning').length == 0) {
$('<p class="ageWarning">The Start and End date of the Tuition Assistance form should not the same. Please verify.</p>').insertAfter('.ageLimit');
$('.Submit').attr('disabled', true);
}
}
else {
$('p.ageWarning').remove();
$('.Submit').removeAttr('disabled');
}
});
});
0
0