Adding error notification

Adding an event in javascript for cases that the date entered is not valid.