Lost Password?

  #1 (permalink)  
Old 12-02-2006, 09:45 AM
TcM's Avatar   
TcM TcM is offline
Moderator
 
Join Date: Aug 2006
Location: In a technologic world :p
Posts: 6,750
Rep Power: 63
TcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud of
Default 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 To view attachments your post count must be 1 or greater. Your post count is 0 momentarily.

Last edited by TcM; 12-03-2006 at 06:30 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 12-30-2006, 01:24 AM
John's Avatar   
John John is offline
Co-Administrator
 
Join Date: Jul 2006
Age: 19
Posts: 2,478
Last Blog:
Random Numbers
Rep Power: 20
John has much to be proud ofJohn has much to be proud ofJohn has much to be proud ofJohn has much to be proud ofJohn has much to be proud ofJohn has much to be proud ofJohn has much to be proud ofJohn has much to be proud of
Send a message via AIM to John
Default

How can I make the buttons display "Read Now" and "Read Later" rather than "Ok" and "Cancel"?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 12-30-2006, 01:47 AM
xtraze xtraze is offline
Programming God
 
Join Date: Dec 2006
Location: Sri lanka
Posts: 921
Rep Power: 0
xtraze is on a distinguished road
Send a message via MSN to xtraze Send a message via Skype™ to xtraze
Default

Good for business type sites and when accepting payments, agreeing to agreements, Terms ect.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 12-30-2006, 05:50 AM
TcM's Avatar   
TcM TcM is offline
Moderator
 
Join Date: Aug 2006
Location: In a technologic world :p
Posts: 6,750
Rep Power: 63
TcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud of
Default

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."
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-14-2007, 08:25 AM
nfy nfy is offline
Newbie
 
Join Date: Feb 2007
Posts: 1
Rep Power: 0
nfy is on a distinguished road
Default

Thx
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
JavaScript:Tutorial, Using Arrays TcM Javascript 20 06-26-2008 02:45 PM
JavaScript:Tutorial, Printing a Webpage TcM Javascript 6 06-07-2008 01:07 PM
JavaScript:Tutorial, MouseOver Image Change TcM Javascript 2 10-30-2007 01:51 PM
JavaScript:Tutorial, Screen Resolution TcM Javascript 6 12-30-2006 05:45 AM
JavaScript:Tutorial, Redirect URL TcM Javascript 2 12-03-2006 04:42 AM


All times are GMT -5. The time now is 01:59 PM.

Contest Stats

John ........ 167.00000
Xav ........ 164.00000
dargueta ........ 148.00000
gaylo565 ........ 18.00000
WingedPanther ........ 15.00000
|pH| ........ 15.00000
Johnnyboy ........ 3.00000
navghost ........ 1.00000

Contest Rules

Ads