Edit in GitHubLog an issue

window.prompt()

Returns: string - message entered by the user in the prompt field or default value if nothing entered.
Since: v7.0.0


Displays a Prompt message dialog putting the application in a modal state while not blocking the Javascript thread and still allowing processing of events in the main event loop.

The following are additional simple alerts supported by UXP

  1. confirm()
  2. alert()
ParamTypeDescription
message
string
A string of text to display to the user.
prompt
string
Default value for the field.

Example

Copied to your clipboard
1// Below prompt function has 2 params
2// "Enter your name: " - Message to display
3// "Adobe" - Default value that will be present in the Prompt pop-up at launch
4prompt("Enter your name: ","Adobe");
Note: 1. Since UXP v7.4, `prompt()` can only be invoked in `plugin` via the featureFlags `enableAlerts`. Update your Manifest v5 with the following
Copied to your clipboard
1"featureFlags": {
2 "enableAlerts": true
3 }
  1. Since UXP v7.4, prompt() is disabled for scripts
Was this helpful?
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.