Util.Prompt() Method

Displays the given text in an input box, with the input area initially containing the default text. Returns the entered/input text.

Syntax

Util.Prompt(Message, Default)

The method syntax has these parts:

Part Description
Message (String) message to display
Default (String)
Return (String) the entered/input text

Remarks

Display the message in a Win32 input box with both an OK and a Cancel button. The input string is is returned if OK is clicked, else an empty string is returned. This duplicates the intrinsic prompt() function found in JScript v3 and earlier, and in Internet Explorer 5 as window.prompt(). This useful function is not intrinsic in JScript V5, so it is supplied here as a convenience. Use InputBox() in VBScript to access the full capabilities of Win32 input boxes.

Will raise an error if the console script was aborted prior to displaying the alert box. This is mostly useful when called from components used by a script.