promptAction

Fires when the action button is clicked (send or stop). Check e.actionType to determine the action.

Event Data

e.actionType String

The type of action: "send" (submitting message) or "stop" (stopping generation).

e.value String

The message text (when actionType is "send").

e.files Array

The array of attached files (when actionType is "send").

Example

<div id="promptbox"></div>
<script>
$("#promptbox").kendoPromptBox({
    placeholder: "Send a message...",
    promptAction: function(e) {
        if (e.actionType === "send") {
            console.log("Sending message:", e.value);
            if (e.value.length < 5) {
                e.preventDefault();
                alert("Message too short!");
            }
        } else if (e.actionType === "stop") {
            console.log("Stop requested");
        }
    }
});
</script>
In this article
promptAction
Not finding the help you need?
Contact Support