473,405 Members | 2,334 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Confirm Dialog Box with Yes/No

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"
Feb 22 '08 #1
21 14500
hsriat
1,654 Expert 1GB
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.
Feb 22 '08 #2
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.
Feb 22 '08 #3
acoder
16,027 Expert Mod 8TB
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".
Feb 22 '08 #4
hmm tat one i have done already. but that is not the complete code..i can't generate dialog box after clicking a link.
Feb 22 '08 #5
acoder
16,027 Expert Mod 8TB
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.
Feb 22 '08 #6
rnd me
427 Expert 256MB
the yes no is a vbscript function: messageBox.
it is not available outside of IE.
Feb 22 '08 #7
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 ??
Feb 25 '08 #8
just check this dialog box of iexplorer.how come you are getting a dialog box with yes/no buttons??

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. </head>
  4. <body text="#000000" bgcolor="#007BFF">
  5. <form method="post" action="" name="closee">
  6. <input type="button" onclick="window.top.close()" value="Close" class="BUTTON"></form>
  7. </body>
  8. </html>
  9.  
Feb 25 '08 #9
hsriat
1,654 Expert 1GB
just check this dialog box of iexplorer.how come you are getting a dialog box with yes/no buttons??

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. </head>
  4. <body text="#000000" bgcolor="#007BFF">
  5. <form method="post" action="" name="closee">
  6. <input type="button" onclick="window.top.close()" value="Close" class="BUTTON"></form>
  7. </body>
  8. </html>
  9.  
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.
Feb 25 '08 #10
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);
Feb 25 '08 #11
acoder
16,027 Expert Mod 8TB
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.
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.
Feb 25 '08 #12
ceck this thing please help me urgent..this
Feb 25 '08 #13
hsriat
1,654 Expert 1GB
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
Feb 25 '08 #14
acoder
16,027 Expert Mod 8TB
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).
Feb 25 '08 #15
The code is JavaScript, so it should work.
vbscript only works in IE.

Any way this is the solution by using the VB code..!!!

Expand|Select|Wrap|Line Numbers
  1. function window.confirm(str)
  2. {
  3.     execScript('n = msgbox("'+str+'","4132")', "VBScript");
  4.  
  5. }
  6.  
  7.  
Feb 26 '08 #16
hsriat
1,654 Expert 1GB
Any way this is the solution by using the VB code..!!!

Expand|Select|Wrap|Line Numbers
  1. function window.confirm(str)
  2. {
  3.     execScript('n = msgbox("'+str+'","4132")', "VBScript");
  4.  
  5. }
  6.  
  7.  

Thats good!

But did you check its working on Firefox?
Feb 26 '08 #17
acoder
16,027 Expert Mod 8TB
Any way this is the solution by using the VB code..!!!

Expand|Select|Wrap|Line Numbers
  1. function window.confirm(str)
  2. {
  3.     execScript('n = msgbox("'+str+'","4132")', "VBScript");
  4.  
  5. }
  6.  
  7.  
A tip: don't test in IE first. Test in a (more) standards-compliant browser, e.g. Firefox, Opera, then test in IE.
Feb 26 '08 #18
Thank you for the tip..!!!
Feb 29 '08 #19
acoder
16,027 Expert Mod 8TB
You're welcome.
Feb 29 '08 #20
This is not working in FF
Oct 6 '10 #21
acoder
16,027 Expert Mod 8TB
If you read the whole thread (or even part of it), you'll realise that the "working" solution is not actually JavaScript, but VBScript which is only supported in IE (last I checked). Use the link posted by hsriat to help make your own DHTML version if it's critical to have a Yes/No confirm box.
Oct 6 '10 #22

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Hans | last post by:
Basically what I would like to do is my own confirm dialog so I can choose the text on the buttons etc. My code looks something like this today if (confirm("Do you want to save?")) //do some...
0
by: Tony Baker | last post by:
Wow. I finally found out the easiest way to display a yes/no (well, yes/cancel) dialog pop up from ASP.Net. Turnes out to be really easy. Just add the following in you Page_Load method (C# code...
2
by: Patrick Delifer | last post by:
Hi, I am trying to implement a JS confirm dialog when a user is deleting something off my Datagrid. The problem is that I don't have a Delete button in which case I could write the following...
3
by: ad | last post by:
I want user can confirm before delete records ? How can I show a confirm dialog when users press a button?
1
by: zhuang | last post by:
With Javascript, i know I could create confirm dialog in ASP.NET app.But the button is yes and cancel, is there anyway to change it to yes and no Thanks zhuang
4
by: mamun | last post by:
Hi All, I have the following situation and am looking for answer in C#. I have a datagrid and putting checkbox next to each record. In the header I have a Delete button. I want users to...
1
by: =?Utf-8?B?UmFq?= | last post by:
In my user control, I have included javascript code using ScriptManager.RegisterClientScriptBlock(). JavaScript code has a confirm message dialog box and we store the message value in a hidden...
0
by: marksommerville | last post by:
Can anyone help? I have a Delete button that processes a request to delete 1 or more records. I want to be able to issue a custom javascript confirm dialog message before I go through my save...
2
by: 00steve | last post by:
Hi, I am using a confirm dialog to display a list of altered records when the user submits changes. I would like it displayed in the following format: Student ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.