The prompt() method displays a pre-configured modal dialog with a custom message and an input box for entering user data.
DayPilot.Modal.prompt(message: string, defaultValue?: string, options?: ModalPromptConfig): Promise<ModalClosedArgs>message (string) - HTML message displayed in the dialog
defaultValue (string) - initial value of the input box
options (ModalPromptConfig) - custom prompt dialog options and standard DayPilot.Modal properties
Returns a Promise that resolves when the modal dialog is closed, using either button or by clicking the background.
The resolved value is the same args object that is passed to the onClosed event handler. The promise rejection handler is never called.
In addition to the standard DayPilot.Modal properties, you can specify custom button text using the options object:
options.okText
options.cancelText
By default, the prompt dialog uses height = 40 and useIframe = false.
const modal = await DayPilot.Modal.prompt("Name:", "Default value");
console.log(modal.result);JavaScript prompt() Replacement [code.daypilot.org]