JavaScript: Dialog Yes/No with customized caption

Ineed to output dialog box like windows.confirm but with the following additional features:
- buttons Yes and No instead of OK and Cancel;
- with my text in window's caption
Is this possible?
[218 byte] By [KellyLynch] at [2007-11-20 7:31:22]
# 1 Re: JavaScript: Dialog Yes/No with customized caption
JavaScript itself cannot do this. But you can create your own pop-up to do so.
PeejAvery at 2007-11-8 0:42:24 >
# 2 Re: JavaScript: Dialog Yes/No with customized caption
Why don't you try the mix of VBScript and Javascript:

<input type=button value="Show Message" onclick="ShowMessage()" />


<script language=vbscript>
function ShowMsg(sMsg)
'1 vbOKCancel: Displays an OK button and a Cancel button
'2 vbAbortRetryIgnore: Displays three buttons: Abort, Retry, and Ignore
'3 vbYesNoCancel: Displays three buttons: Yes, No, and Cancel
'4 vbYesNo: Displays a Yes button and a No button (This is the one we wanted)
'5 vbRetryCancel: Displays a Retry button and a Cancel button
'6 vbOKOnly: Displays one button with a label of OK
ShowMsg = MsgBox(sMsg, 2, "Custom Message")
end function
</script>
<script language=javascript>
function ShowMessage()
{
var responseCode = ShowMsg('This is the message, with custom options' );
/*
responseCode=
1: OK button was pressed
2: Cancel button was pressed
3: Abort button was pressed
4: Retry button was pressed
5: Ignore button was pressed
6: Yes button was pressed
7: No button was pressed
*/
}
anupam kant at 2007-11-8 0:43:21 >
# 3 Re: JavaScript: Dialog Yes/No with customized caption
Why don't you try the mix of VBScript and Javascript:
Well, that is an option but limits a person to only using IE.
PeejAvery at 2007-11-8 0:44:25 >
# 4 Re: JavaScript: Dialog Yes/No with customized caption
Here is a wonderful answer! Please click the link!

Google It! (http://www.google.com/search?hl=en&q=js+prototype+window)

But if this is too advanced, or you just want something simple, try using a popup window with a form and some buttons. Or try using a hidden DIV that shows up with an event, with a form and some buttons.
code? at 2007-11-8 0:45:26 >