Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • Javascript:Confirmation Dialog Box

    • 0
    • 1
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 189
    Comment on it

    Confirmation dialog Box is used to get confirmation on any input. It is mostly used to take user's opinion on any option. It displays a dialog box with two buttons: Cancel and OK.

    If the user clicks on the Cancel button, then confirm() returns false.

    Similarly when the user clicks on the OK button, the window method confirm() will return true.

    Have a look on this simple example to understand the concept of confirmation dialog box: -

          <p>Click on the button below to confirm </p>
             <input type="button" value="Click Me" onclick="getConfirmation();" />
          <script type="text/javascript">
                function getConfirmation(){
                   var retVal = confirm("Do you want to continue ?");
                   if( retVal == true ){
                      document.write ("Reeady to continue");
                      return true;
                      document.write ("Not ready to continue");
                      return false;

 0 Comment(s)

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: