Support » Plugin: CMB2 » Clear empty timepicker on blur

  • Resolved Patrick


    We’ve got a text_timepicker for an optional End Time on an event post. When someone inadvertently clicks in the field, and then leaves it, the default time (12:00 AM) is set, and it’s not intuitive how to clear the field (leaving a 0 or a single space in it will suffice). Is there a way using jQuery (or some other way) to set the field’s value to '' on blur if there’s not a user-set time in there?

Viewing 1 replies (of 1 total)
  • Plugin Author Justin Sternberg


    Hey Patrick, this is definitely something doable. Would require some custom javascript to store the initial state, and on blur compare w/ the initial state to see if it changed. However, that’s outside the scope of the support we are comfortable giving, as it is definitely in custom territory. We’ll leave the topic open for a bit, in case others would like to offer suggestions.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.