• Hi

    If a user enters invalid text into the datetimepicker and either clicks or tabs away, there is no action taken. If the user then clicks back on the datetimepicker (or tabs to it), on focus the invalid text is changed to the current datetime, or a valid datetime if one can be interpreted from the entered text. It is a requirement that my users be able to manually enter a date/time, so how can I enforce the sort of validation that occurs on focus?

    A further, sort of related question :- if I wish to set the value of the datetimepicker field programmatically from JS or JQuery, how can I trigger a validation check of the data? I have tried by setting focus to the field, which works however it leaves the popup open.

    • This topic was modified 11 months, 2 weeks ago by 1968phillip.
Viewing 1 replies (of 1 total)
  • Hey @1968phillip

    Consider switching to a dropdown for date selection instead of text field .

    For setting values programmatically and closing the popup, you can use the hide method something like $datetimepicker.datepicker(“hide”);

    That method is used to close the popup after setting the value.

    Best,

Viewing 1 replies (of 1 total)
  • The topic ‘Invalid data allowed?’ is closed to new replies.