Yes / No Confirm Alert Box

Is there a predefined way to display a Message to the user giving them a Yes and No button that is as easy to code as Alert in JavaScript? What I what to do is provide the user a confirm box after the click the delete button and I want them to have a Yes and No button to click in an alert box (or at least look like an alert box). If there is not a predefined function, can you get me started on how I would accomplish this is JavaScript?

Thanks


<SCRIPT language="JavaScript">
function say_hi()
{
    var hi= confirm("Do you really want me to say hi?");
    if (hi== true){
        alert("hi");
    }else{
        alert("Meany!!!");
    }
}
 </SCRIPT>

Rather than alert() you use confirm() and assign the resulting response to a variable which can then be evaluated.


<script type="text/javascript">
function DoFunc()
{
    if (confirm('Are you sure?'))
    {
        alert('Okay then.');
    }
}
</script>

Thanks for the code. Is it fair to make this assumption… the OK and CANCEL buttons are the interent standard to the YES NO buttons in an application?

yes, it’s the same thing anyway.