PDA

View Full Version : What is the difference between an alert box and a confirmation box?



ajay49560
06-12-2015, 06:42 AM
Hello friends,

Please provide right solutions....

irfan
06-18-2015, 08:09 AM
Alert Box:
An alert box is often used if you want to make sure information comes through to the user.

When an alert box pops up, the user will have to click "OK" to proceed.

Confirm Box:

A confirm box is often used if you want the user to verify or accept something.

When a confirm box pops up, the user will have to click either "OK" or "Cancel" to proceed.

If the user clicks "OK", the box returns true. If the user clicks "Cancel", the box returns false.

beastlinks777
06-18-2015, 11:51 PM
Alert Box:
An alert box is often used if you want to make sure information comes through to the user.

When an alert box pops up, the user will have to click "OK" to proceed.

Confirm Box:

A confirm box is often used if you want the user to verify or accept something.

When a confirm box pops up, the user will have to click either "OK" or "Cancel" to proceed.

If the user clicks "OK", the box returns true. If the user clicks "Cancel", the box returns false.

If the user clicks "cancel" then it will not be executed?

daviddakarai
06-22-2015, 04:20 AM
Alert() dialog:

The alert() dialog box is used to communicate a message to the user (generally warnings of missed actions). For example, if the email address entered is wrong, you can use the alert() message to warn the user about it. Developers also use alerts() as a quick and dirty way to debug their applications.

// warning
alert("Invalid email address. Please enter again.");
// debugging
alert(currentCounter);



The alert() method creates a new pop-up window (dialog box) which contains the user message and an
OK button. This is a modal window and all execution is stopped until the user clicks the OK button in the pop-up box.

Confirm() dialog:

The confirm dialog box is used to confirm a user’s answer to a question. This method takes only one argument, the question you will ask the user. A question mark will appear in the box with an OK button and a Cancel button. If the user clicks the OK button, true is returned; if he or she clicks the Cancel button, false is returned. This is also a modal dialog - the user must agree before the action is completed. You often see this in shopping cart applications just before placing the order or on file sharing sites just before you delete a file.


if (confirm("Are you sure you want to delete your profile photo?") == true) {
alert("Deleting photo...");
}
else {
alert("Glad you decided against deleting the photo!");
}

thuybk
06-22-2015, 06:36 AM
An alert box displays only one button which is the OK button whereas the Confirm box displays two buttons namely OK and cancel.

Yagnik_patel
06-23-2015, 06:37 AM
alert box pop up when user enter something wrong according to site.
when conformation box pop up when user information or query successful Submit to srever.

sophia ellison
06-24-2015, 03:43 AM
Alert box is mainly used to communicate a message to the user and displays one ok button and confirm box is opposite to alert box. Confirm box has two buttons such as true or false and ok or cancel. User can choose one button depending on the user’s choice.