+ Reply to Thread
Results 1 to 6 of 6

Thread: JavaScript:Tutorial, Confirmation Box

  1. #1
    TcM
    TcM is offline
    Code Warrior TcM is a name known to all TcM is a name known to all TcM is a name known to all TcM is a name known to all TcM is a name known to all TcM is a name known to all TcM's Avatar
    Join Date
    Aug 2006
    Posts
    11,461
    Blog Entries
    6

    JavaScript:Tutorial, Confirmation Box

    Introduction:-
    Welcome to another JavaScript tutorial of mine..This will code will determine if the user pressed Ok or Cancel

    Solution:-
    This code goes in the <head> tags:-

    Code:
    <SCRIPT language="JavaScript">
    function Confirm_Ok_Cancel()
    {
     var Ok_Cancel= confirm("Press Ok or Cancel!");
     if (Ok_Cancel== true)
     {
       alert("You pressed Ok");
     }
     else
     {
      alert("You Pressed Cancel");
      }
    }
    </SCRIPT>
    And this as your body:-
    Code:
    <body onLoad="Confirm_Ok_Cancel()">
    Explanation:-
    I think it's self explanatory no need of explanations!

    A Preview:-


    Conclusion:-
    As Always Feedback is welcome and the full source is attached!!
    Attached Files
    Last edited by TcM; 12-03-2006 at 06:30 AM.

  2. #2
    Co-Administrator John is a glorious beacon of light John is a glorious beacon of light John is a glorious beacon of light John is a glorious beacon of light John is a glorious beacon of light John's Avatar
    Join Date
    Jul 2006
    Age
    21
    Posts
    5,884
    Blog Entries
    25
    How can I make the buttons display "Read Now" and "Read Later" rather than "Ok" and "Cancel"?

  3. #3
    Programming God xtraze is an unknown quantity at this point
    Join Date
    Dec 2006
    Location
    Sri lanka
    Posts
    908
    Good for business type sites and when accepting payments, agreeing to agreements, Terms ect.

  4. #4
    TcM
    TcM is offline
    Code Warrior TcM is a name known to all TcM is a name known to all TcM is a name known to all TcM is a name known to all TcM is a name known to all TcM is a name known to all TcM's Avatar
    Join Date
    Aug 2006
    Posts
    11,461
    Blog Entries
    6
    Quote Originally Posted by Sidewinder View Post
    How can I make the buttons display "Read Now" and "Read Later" rather than "Ok" and "Cancel"?
    That can't be done as far as I know, you need to say in the Confirmation box for Example "To Read Now press Ok to Read Later press Cancel."

  5. #5
    nfy
    nfy is offline
    Newbie nfy is an unknown quantity at this point
    Join Date
    Feb 2007
    Posts
    1
    Thx

  6. #6
    Newbie linkdere8 is an unknown quantity at this point linkdere8's Avatar
    Join Date
    Nov 2009
    Posts
    2

    Re: JavaScript:Tutorial, Confirmation Box

    thx.. it's really help me out of my problem...!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. JavaScript:Tutorial, Using Arrays
    By TcM in forum Javascript
    Replies: 25
    Last Post: 07-27-2009, 06:13 AM
  2. JavaScript:Tutorial, MouseOver Image Change
    By TcM in forum Javascript
    Replies: 4
    Last Post: 06-06-2009, 08:49 AM
  3. JavaScript:Tutorial, Printing a Webpage
    By TcM in forum Javascript
    Replies: 7
    Last Post: 06-05-2009, 02:20 AM
  4. JavaScript:Tutorial, Screen Resolution
    By TcM in forum Javascript
    Replies: 6
    Last Post: 12-30-2006, 05:45 AM
  5. JavaScript:Tutorial, Redirect URL
    By TcM in forum Javascript
    Replies: 2
    Last Post: 12-03-2006, 04:42 AM

Bookmarks

Bookmarks

     
        Algorithms and Data Structures

        Java tutorials

        Algorithms Forum

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts