Hi all
I'm using the calendar question from the library, allowing folk to either enter the date directly or enter from the calendar. I want to verify that what they enter is a valid date (ie not after today).
When I enter a date that's not valid, it lets me through, but just saves it as if I entered today's date. What I'd like is an error message to come up. Can someone help please? Here's what I have:
var now = Date.now();
if (!$('#[% QuestionName() %]_Unix').val()) {
strErrorMessage = 'A response is required.';
}
if (SSI_GetValue('Calendar_Unix') > now){
strErrorMessage = "You can't enter a date that is in the future.";
}