Yes/No/Cancel box using javascript

I know that javascript doesn’t have a simple yes/no/cancel box, but am hoping that someone who has designed one can post their code. This would save me a lot of time and would be greatly appreciated.

Thanks!

Subject: Yes/No/Cancel box using javascript

It doesn’t have Yes/No/Cancel, but it does have confirm.

if(window.confirm(“Do you want to save this form?”))

theForm.submit();

Subject: Yes/No/Cancel box using javascript

You could create your own new window web dialog box, but you may have issues with popup blockers. Or, if you’re pretty good at DHTML, you can create one that is part of the page.

Subject: Yes/No/Cancel box using javascript

I’m no JavaScript expert but there is “confirm()” – although its defined responses aren’t yes/no/cancel.var rsp = confirm(“Press a button”);

if (rsp) {

alert(“You pressed the OK button!”);

} else {

alert(“You pressed the Cancel button!”);

}

If that won’t work, search for it. It has undoubtedly been done and posted somewhere – find it. This looks promising.

dgg

Subject: RE: Yes/No/Cancel box using javascript

Dallas -

Thanks for the response. I looked at the code from the link you sent and have been able to successfully implement it in my web app. I appreciate your assistance!

Dave