View Single Post
  #1 (permalink)  
Old 12-02-2006, 09:45 AM
TcM's Avatar   
TcM TcM is online now
Code Warrior
 
Join Date: Aug 2006
Posts: 9,841
Blog Entries: 6
Rep Power: 82
TcM is a name known to allTcM is a name known to allTcM is a name known to allTcM is a name known to allTcM is a name known to allTcM is a name known to all
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 in this forum your post count must be 1 or greater. You currently have 0 posts.

Last edited by TcM; 12-03-2006 at 06:30 AM..
Reply With Quote