How to do input validation?

How can I make use of input validation in Panel? For example, I am using a DatetimeInput. If I enter a bad time, it will display (invalid) in the name but I don’t see a way to check that programmatically. It looks like if invalid input is entered, it just keeps the previous value despite displaying the erroneous one. Similarly for the AutocompleteInput, if I enter an invalid choice, it doesn’t show anything and will just use the default/previous value.

I think it’s done on the Javascript side, so either

  1. might not have control over invalid choices
  2. might need to use jscallback
  3. unrestrict all choices and watch on python end