See also: alert, confirm |
Displays a Prompt dialog box with a message and an input field.
JSV_prompt(title, msg, defaultMsg)
n/a
The prompt method returns the user's input or the default value of the input field.
The prompt function uses the following arguments.
Argument | Description |
title | A string to be displayed in the dialog title bar |
msg | A string to be displayed as the message to the user |
defaultMsg | A string or integer representing the default value of the input field |
If the user clicks the Cancel button, the return value is "undefined".
n/a
The following lines of code
function testPrompt() {
var amountOrdered = JSV_prompt("JavaScript Vision Prompt", "Enter the number of widgets you would like to order:", 1);
JSV_alert("Widgets, Inc.", "You ordered " + amountOrdered + " widgets.");
}
produce
Copyright © 2000 Roaring Fork Software. All rights reserved.