+ Reply to Thread
Results 1 to 6 of 6

Thread: JavaScript:Tutorial, Confirmation Box

  1. #1
    Join Date
    Aug 2006
    Posts
    11,209
    Blog Entries
    6
    Rep Power
    101

    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 Attached Files
    Last edited by TcM; 12-03-2006 at 04:30 AM.

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Join Date
    Jul 2006
    Location
    Amherst, New York, United States
    Posts
    6,277
    Blog Entries
    26
    Rep Power
    20
    How can I make the buttons display "Read Now" and "Read Later" rather than "Ok" and "Cancel"?

  4. #3
    xtraze is offline Programming God
    Join Date
    Dec 2006
    Location
    Sri lanka
    Posts
    911
    Rep Power
    0
    Good for business type sites and when accepting payments, agreeing to agreements, Terms ect.

  5. #4
    Join Date
    Aug 2006
    Posts
    11,209
    Blog Entries
    6
    Rep Power
    101
    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."

  6. #5
    nfy Guest
    Thx

  7. #6
    linkdere8's Avatar
    linkdere8 is offline Newbie
    Join Date
    Nov 2009
    Posts
    2
    Rep Power
    0

    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 Tutorials
    Replies: 25
    Last Post: 07-27-2009, 04:13 AM
  2. JavaScript:Tutorial, Your First Game!
    By TcM in forum JavaScript Tutorials
    Replies: 35
    Last Post: 06-11-2009, 01:27 PM
  3. JavaScript:Tutorial, Prompt
    By TcM in forum JavaScript Tutorials
    Replies: 2
    Last Post: 01-21-2007, 01:58 AM
  4. JavaScript:Tutorial, Loops
    By TcM in forum JavaScript Tutorials
    Replies: 4
    Last Post: 12-13-2006, 06:53 AM

Tags for this Thread

Bookmarks

Posting Permissions

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