473,466 Members | 1,394 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Confirm Dialog Box with Yes/No

raveendrabikkina
26 New Member
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 14502
hsriat
1,654 Recognized Expert Top Contributor
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
raveendrabikkina
26 New Member
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 Recognized Expert Moderator MVP
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
raveendrabikkina
26 New Member
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 Recognized Expert Moderator MVP
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 Recognized Expert Contributor
the yes no is a vbscript function: messageBox.
it is not available outside of IE.
Feb 22 '08 #7
raveendrabikkina
26 New Member
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
raveendrabikkina
26 New Member
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 Recognized Expert Top Contributor
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
raveendrabikkina
26 New Member
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 Recognized Expert Moderator MVP
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
raveendrabikkina
26 New Member
ceck this thing please help me urgent..this
Feb 25 '08 #13
hsriat
1,654 Recognized Expert Top Contributor
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 Recognized Expert Moderator MVP
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
raveendrabikkina
26 New Member
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 Recognized Expert Top Contributor
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 Recognized Expert Moderator MVP
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
raveendrabikkina
26 New Member
Thank you for the tip..!!!
Feb 29 '08 #19
acoder
16,027 Recognized Expert Moderator MVP
You're welcome.
Feb 29 '08 #20
This is not working in FF
Oct 6 '10 #21
acoder
16,027 Recognized Expert Moderator MVP
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 ...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.