Confirm Dialog Box...!!!  | Newbie | | Join Date: Feb 2008
Posts: 22
| | |
I want the confirm dialog box with "yes/no" buttons rather than the default "ok/cancel" buttons of confirm dialog box. what is the syntax for getting that .
P.S: one thing don't tell me the about the vbscript embeded in the javascript.it's looking odd "with a vbscript prompt"
|  | Expert | | Join Date: Jan 2008 Location: Bath, UK
Posts: 1,631
| | | re: Confirm Dialog Box...!!! Quote:
Originally Posted by raveendrabikkina I want the confirm dialog box with "yes/no" buttons rather than the default "ok/cancel" buttons of confirm dialog box. what is the syntax for getting that .
P.S: one thing don't tell me the about the vbscript embeded in the javascript.it's looking odd "with a vbscript prompt" Thats not possible with that typical confirmation box. You will need to change your message so that it fits ok and cancel.
But you can build popup DIVs as the same purpose.
Have a look at this.
|  | Newbie | | Join Date: Feb 2008
Posts: 22
| | | re: Confirm Dialog Box...!!! Quote:
Originally Posted by hsriat Thats not possible with that typical confirmation box. You will need to change your message so that it fits ok and cancel.
But you can build popup DIVs as the same purpose.
Have a look at this. No that is possible..!!! because we are using one application which has the popup with yes/no buttons(for internet explorer) but the code is not available for me son only i'm asking.
|  | Site Moderator | | Join Date: Nov 2006 Location: UK
Posts: 14,750
| | | re: Confirm Dialog Box...!!! Quote:
Originally Posted by raveendrabikkina No that is possible..!!! because we are using one application which has the popup with yes/no buttons(for internet explorer) but the code is not available for me son only i'm asking. Why is the code not available? Just do a "view source".
|  | Newbie | | Join Date: Feb 2008
Posts: 22
| | | re: Confirm Dialog Box...!!!
hmm tat one i have done already. but that is not the complete code..i can't generate dialog box after clicking a link.
|  | Site Moderator | | Join Date: Nov 2006 Location: UK
Posts: 14,750
| | | re: Confirm Dialog Box...!!! Quote:
Originally Posted by raveendrabikkina hmm tat one i have done already. but that is not the complete code..i can't generate dialog box after clicking a link. Post your code.
|  | Expert | | Join Date: Jun 2007 Location: Urbana IL
Posts: 417
| | | re: Confirm Dialog Box...!!!
the yes no is a vbscript function: messageBox.
it is not available outside of IE.
|  | Newbie | | Join Date: Feb 2008
Posts: 22
| | | re: Confirm Dialog Box...!!!
hey wat abt that dialog box with yes/no buttons which is displayed while we are trying to close a window???
if tat is possible y can't we use the same ??
|  | Newbie | | Join Date: Feb 2008
Posts: 22
| | | re: Confirm Dialog Box...!!!
just check this dialog box of iexplorer.how come you are getting a dialog box with yes/no buttons?? -
<html>
-
<head>
-
</head>
-
<body text="#000000" bgcolor="#007BFF">
-
<form method="post" action="" name="closee">
-
<input type="button" onclick="window.top.close()" value="Close" class="BUTTON"></form>
-
</body>
-
</html>
-
|  | Expert | | Join Date: Jan 2008 Location: Bath, UK
Posts: 1,631
| | | re: Confirm Dialog Box...!!! Quote:
Originally Posted by raveendrabikkina just check this dialog box of iexplorer.how come you are getting a dialog box with yes/no buttons?? -
<html>
-
<head>
-
</head>
-
<body text="#000000" bgcolor="#007BFF">
-
<form method="post" action="" name="closee">
-
<input type="button" onclick="window.top.close()" value="Close" class="BUTTON"></form>
-
</body>
-
</html>
-
Alert boxes, and confirmation boxes are something which are inbuilt. You can use them, and we have been given the right to change the message inside it. NO COLORS, NO YES/NO, NO HTML INSIDE IT!!
That may happen later, but according to my knowledge, with the current version, you can NOT change OK, Cancel with Yes, No just by providing an extra flag like confirm('Is this confirm box using Yes No?', USE_YES_NO);
Although I guess it would have been quite good if we were able to do such changes with these flags.
If you really and badly need to change it to YES/NO, read the code at the link I provided you in the second post, and be innovative!
And as for as that prompt box shown at the window-closing is concerned, that is something used by the browser itself, not JavaScript. You may get similar prompt messages in may other events, like when you download something, when you enter an encrypted page etc.
|  | Newbie | | Join Date: Feb 2008
Posts: 22
| | | re: Confirm Dialog Box...!!! Quote:
Originally Posted by hsriat Alert boxes, and confirmation boxes are something which are inbuilt. You can use them, and we have been given the right to change the message inside it. NO COLORS, NO YES/NO, NO HTML INSIDE IT!!
That may happen later, but according to my knowledge, with the current version, you can NOT change OK, Cancel with Yes, No just by providing an extra flag like confirm('Is this confirm box using Yes No?', USE_YES_NO);
Although I guess it would have been quite good if we were able to do such changes with these flags.
If you really and badly need to change it to YES/NO, read the code at the link I provided you in the second post, and be innovative!
And as for as that prompt box shown at the window-closing is concerned, that is something used by the browser itself, not JavaScript. You may get similar prompt messages in may other events, like when you download something, when you enter an encrypted page etc. the thing you are talking abt the below line is possible only in java that is java gui applications like Jdialog box or someting but it is not intended for the javascript.and one thing we can get that dialog box using vbscript in javascript confirm('Is this confirm box using Yes No?', USE_YES_NO); |  | Site Moderator | | Join Date: Nov 2006 Location: UK
Posts: 14,750
| | | re: Confirm Dialog Box...!!! Quote:
Originally Posted by raveendrabikkina the thing you are talking abt the below line is possible only in java that is java gui applications like Jdialog box or someting but it is not intended for the javascript. The code is JavaScript, so it should work. Quote:
Originally Posted by raveendrabikkina and one thing we can get that dialog box using vbscript in javascript confirm('Is this confirm box using Yes No?', USE_YES_NO); vbscript only works in IE.
|  | Newbie | | Join Date: Feb 2008
Posts: 22
| | | re: Confirm Dialog Box...!!!
ceck this thing please help me urgent.. this |  | Expert | | Join Date: Jan 2008 Location: Bath, UK
Posts: 1,631
| | | re: Confirm Dialog Box...!!! Quote:
Originally Posted by raveendrabikkina ceck this thing please help me urgent..this
Sorry, thats JAVA and I'm not master of all!
Actually, I'm not even master of one. :D |  | Site Moderator | | Join Date: Nov 2006 Location: UK
Posts: 14,750
| | | re: Confirm Dialog Box...!!! Quote:
Originally Posted by raveendrabikkina ceck this thing please help me urgent..this Java != JavaScript. Asking for Java help in the JavaScript forum is not a good idea. A Java expert should get to it soon enough (hopefully).
|  | Newbie | | Join Date: Feb 2008
Posts: 22
| | | re: Confirm Dialog Box...!!! Quote:
Originally Posted by acoder The code is JavaScript, so it should work.
vbscript only works in IE.
Any way this is the solution by using the VB code..!!! -
function window.confirm(str)
-
{
-
execScript('n = msgbox("'+str+'","4132")', "VBScript");
-
-
}
-
-
|  | Expert | | Join Date: Jan 2008 Location: Bath, UK
Posts: 1,631
| | | re: Confirm Dialog Box...!!! Quote:
Originally Posted by raveendrabikkina Any way this is the solution by using the VB code..!!! -
function window.confirm(str)
-
{
-
execScript('n = msgbox("'+str+'","4132")', "VBScript");
-
-
}
-
-
Thats good!
But did you check its working on Firefox?
|  | Site Moderator | | Join Date: Nov 2006 Location: UK
Posts: 14,750
| | | re: Confirm Dialog Box...!!! Quote:
Originally Posted by raveendrabikkina Any way this is the solution by using the VB code..!!! -
function window.confirm(str)
-
{
-
execScript('n = msgbox("'+str+'","4132")', "VBScript");
-
-
}
-
-
A tip: don't test in IE first. Test in a (more) standards-compliant browser, e.g. Firefox, Opera, then test in IE.
|  | Newbie | | Join Date: Feb 2008
Posts: 22
| | | re: Confirm Dialog Box...!!!
Thank you for the tip..!!!
|  | Site Moderator | | Join Date: Nov 2006 Location: UK
Posts: 14,750
| | | re: Confirm Dialog Box...!!!
You're welcome.
|  | Similar JavaScript / Ajax / DHTML bytes | | | Forums
Visit our community forums for general discussions and latest on Bytes
/bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 229,155 network members.
|