Questions tagged [confirm]

For questions regarding the JavaScript `confirm` function or other such functions that ask the user for yes/no confirmation.

In JavaScript the confirm method takes a single string parameter, the statement that the user is confirming, and return true/false for whether the user clicked 'OK' (true) or 'Cancel'/Close (false).

The Window.confirm() method displays a modal dialog with an optional message and two buttons, OK and Cancel.

Resources

741 questions
288
votes
18 answers

How to show the "Are you sure you want to navigate away from this page?" when changes committed?

Here in stackoverflow, if you started to make changes then you attempt to navigate away from the page, a javascript confirm button shows up and asks: "Are you sure you want to navigate away from this page?" blee blah bloo... Has anyone implemented…
Shimmy Weitzhandler
  • 92,920
  • 119
  • 388
  • 596
202
votes
6 answers

JavaScript Form Submit - Confirm or Cancel Submission Dialog Box

For a simple form with an alert that asks if fields were filled out correctly, I need a function that does this: Shows an alert box when button is clicked with two options: If "OK" is clicked, the form is submitted If cancel is clicked, the alert…
matt
  • 2,280
  • 2
  • 14
  • 17
114
votes
9 answers

Javascript Confirm popup Yes, No button instead of OK and Cancel

Javascript Confirm popup, I want to show Yes, No button instead of OK and Cancel. I have used this vbscript code: