Check on date with TDBDateEdit lazarus / 16-Databases ---------------------------------------------------------------------- mangakissa · 2017-03-03 13:39 I use TDBDateEdit to fill the birthday of a person. If I type in '33-3-2012' the object checks if the date is valid. If doesn't the fieldvalue is set to NULL (30-12-1899). There's no warning of invalid date. That's very nice. the application doesn't reproduce an error dialog with the option to kill the program.  I know the field is NULL, because event onEditingDone gives the zero date (also when checking the date before saving the actual record) Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i showmessage(datetostr(birthday.date))So how do I tell the user that the filled in dat is invalid. Now the record is saved without a date. ---------------------------------------------------------------------- rvk · 2017-03-03 14:02 Quote from: mangakissa on March 03, 2017, 02:39:03 pmI know the field is NULL, because event onEditingDone gives the zero date (also when checking the date before saving the actual record) The OnEditingDone doesn't "give" anything. It's just an event. What value do you check in OnEditingDone? I'm not sure how it's in TDBDateEdit, but in TDateEdit the TDateEdit.Text has the invalid value just before validating is done. TDateEdit.Date isn't filled yet and can only be filled after validation. So checking TDateEdit.Text yourself in OnEditingDone should work. QuoteOnEditDone: Event handler when editing is done. The user definitely has finished editing, the resulting text e.g. can be validated. ---------------------------------------------------------------------- mangakissa · 2017-03-03 15:09 You're absolutely right. Sometimes I forget there are other properties to check.