Confirm Dialog Box with Yes/No

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • raveendrabikkina
    New Member
    • Feb 2008
    • 26

    Confirm Dialog Box with Yes/No

    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
    Recognized Expert Top Contributor
    • Jan 2008
    • 1653

    #2
    Originally posted by raveendrabikkin a
    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.

    Comment

    • raveendrabikkina
      New Member
      • Feb 2008
      • 26

      #3
      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.

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        Originally posted by raveendrabikkin a
        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".

        Comment

        • raveendrabikkina
          New Member
          • Feb 2008
          • 26

          #5
          hmm tat one i have done already. but that is not the complete code..i can't generate dialog box after clicking a link.

          Comment

          • acoder
            Recognized Expert MVP
            • Nov 2006
            • 16032

            #6
            Originally posted by raveendrabikkin a
            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.

            Comment

            • rnd me
              Recognized Expert Contributor
              • Jun 2007
              • 427

              #7
              the yes no is a vbscript function: messageBox.
              it is not available outside of IE.

              Comment

              • raveendrabikkina
                New Member
                • Feb 2008
                • 26

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

                Comment

                • raveendrabikkina
                  New Member
                  • Feb 2008
                  • 26

                  #9
                  just check this dialog box of iexplorer.how come you are getting a dialog box with yes/no buttons??

                  Code:
                  <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>

                  Comment

                  • hsriat
                    Recognized Expert Top Contributor
                    • Jan 2008
                    • 1653

                    #10
                    Originally posted by raveendrabikkin a
                    just check this dialog box of iexplorer.how come you are getting a dialog box with yes/no buttons??

                    Code:
                    <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.

                    Comment

                    • raveendrabikkina
                      New Member
                      • Feb 2008
                      • 26

                      #11
                      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);

                      Comment

                      • acoder
                        Recognized Expert MVP
                        • Nov 2006
                        • 16032

                        #12
                        Originally posted by raveendrabikkin a
                        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.
                        Originally posted by raveendrabikkin a
                        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.

                        Comment

                        • raveendrabikkina
                          New Member
                          • Feb 2008
                          • 26

                          #13
                          ceck this thing please help me urgent..this

                          Comment

                          • hsriat
                            Recognized Expert Top Contributor
                            • Jan 2008
                            • 1653

                            #14
                            Originally posted by raveendrabikkin a
                            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

                            Comment

                            • acoder
                              Recognized Expert MVP
                              • Nov 2006
                              • 16032

                              #15
                              Originally posted by raveendrabikkin a
                              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).

                              Comment

                              Working...