Posted By

chopbust on 10/28/10


javascript confirm

Versions (?)

Who likes this?

1 person have marked this snippet as a favorite


Confirm an action using Javascript

 / Published in: JavaScript

When a link is clicked, call up this function.

Parameter message = message you want to display after click url = page you want to forward to if the user clicks OK

  1. function confirmMessage(message, url) {
  2. if (confirm(message)) {
  3. location.href = url;
  4. }
  5. }

Report this snippet  

You need to login to post a comment.