Connecting Tech Pros Worldwide Forums | Help | Site Map

Confirm Dialog Box...!!!

raveendrabikkina's Avatar
Newbie
 
Join Date: Feb 2008
Posts: 22
#1: Feb 22 '08
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"

hsriat's Avatar
Expert
 
Join Date: Jan 2008
Location: Bath, UK
Posts: 1,631
#2: Feb 22 '08

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.
raveendrabikkina's Avatar
Newbie
 
Join Date: Feb 2008
Posts: 22
#3: Feb 22 '08

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.
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,750
#4: Feb 22 '08

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".
raveendrabikkina's Avatar
Newbie
 
Join Date: Feb 2008
Posts: 22
#5: Feb 22 '08

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.
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,750
#6: Feb 22 '08

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.
rnd me's Avatar
Expert
 
Join Date: Jun 2007
Location: Urbana IL
Posts: 417
#7: Feb 22 '08

re: Confirm Dialog Box...!!!


the yes no is a vbscript function: messageBox.
it is not available outside of IE.
raveendrabikkina's Avatar
Newbie
 
Join Date: Feb 2008
Posts: 22
#8: Feb 25 '08

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 ??
raveendrabikkina's Avatar
Newbie
 
Join Date: Feb 2008
Posts: 22
#9: Feb 25 '08

re: Confirm Dialog Box...!!!


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.  
hsriat's Avatar
Expert
 
Join Date: Jan 2008
Location: Bath, UK
Posts: 1,631
#10: Feb 25 '08

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??

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.
raveendrabikkina's Avatar
Newbie
 
Join Date: Feb 2008
Posts: 22
#11: Feb 25 '08

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);
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,750
#12: Feb 25 '08

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.
raveendrabikkina's Avatar
Newbie
 
Join Date: Feb 2008
Posts: 22
#13: Feb 25 '08

re: Confirm Dialog Box...!!!


ceck this thing please help me urgent..this
hsriat's Avatar
Expert
 
Join Date: Jan 2008
Location: Bath, UK
Posts: 1,631
#14: Feb 25 '08

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
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,750
#15: Feb 25 '08

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).
raveendrabikkina's Avatar
Newbie
 
Join Date: Feb 2008
Posts: 22
#16: Feb 26 '08

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..!!!

Expand|Select|Wrap|Line Numbers
  1. function window.confirm(str)
  2. {
  3.     execScript('n = msgbox("'+str+'","4132")', "VBScript");
  4.  
  5. }
  6.  
  7.  
hsriat's Avatar
Expert
 
Join Date: Jan 2008
Location: Bath, UK
Posts: 1,631
#17: Feb 26 '08

re: Confirm Dialog Box...!!!


Quote:

Originally Posted by raveendrabikkina

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?
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,750
#18: Feb 26 '08

re: Confirm Dialog Box...!!!


Quote:

Originally Posted by raveendrabikkina

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.
raveendrabikkina's Avatar
Newbie
 
Join Date: Feb 2008
Posts: 22
#19: Feb 29 '08

re: Confirm Dialog Box...!!!


Thank you for the tip..!!!
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,750
#20: Feb 29 '08

re: Confirm Dialog Box...!!!


You're welcome.
Reply