Показать сообщение отдельно
Старый 09.06.2004, 12:35     # 3
dmitryelf
Junior Member
 
Аватар для dmitryelf
 
Регистрация: 22.04.2004
Сообщения: 99

dmitryelf Молодецdmitryelf Молодецdmitryelf Молодец
Confirm
Displays a Confirm dialog box with the specified message and OK and Cancel buttons. Method of Window

Syntax

confirm("message")

Parameters message A string.

Description
A confirm dialog box looks as follows:

Use the confirm method to ask the user to make a decision that requires either an OK or a Cancel. The message argument specifies a message that prompts the user for the decision. The confirm method returns true if the user chooses OK and false if the user chooses Cancel.

You cannot specify a title for a confirm dialog box, but you can use the open method to create your own confirm dialog. See open.

Examples
This example uses the confirm method in the confirmCleanUp function to confirm that the user of an application really wants to quit. If the user chooses OK, the custom cleanUp function closes the application.

function confirmCleanUp() { if (confirm("Are you sure you want to quit this application?")) { cleanUp() }}
You can call the confirmCleanUp function in the onClick event handler of a form's push button, as shown in the following example:

<INPUT TYPE="button" VALUE="Quit" onClick="confirmCleanUp()">

See also
Window.alert, Window.prompt
dmitryelf вне форума