def METHOD_NAME(self, callback, remove=False):
    """(Un)Register a callback to handle text submission.
    Triggered when the user clicks enter.
    Parameters
    ----------
    callback: callable
        Will be called with exactly one argument: the Widget instance
    remove: bool (optional)
        Whether to unregister the callback
    """
    deprecation("on_submit is deprecated. Instead, set the .continuous_update attribute to False and observe the value changing with: mywidget.observe(callback, 'value').")
    self._submission_callbacks.register_callback(callback, remove=remove)