Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 09-06-2009
Member
 
Join Date: May 2009
Posts: 834
Javascript OK/Cancel Message Box Example

Hello , Can Anybody please Give me An Example of Javascript OK/Cancel Message Box , I am Learning Java and Want to Write a small Program With Has this message box Please Help Thanks in Advance
Reply With Quote
  #2  
Old 09-06-2009
Member
 
Join Date: Feb 2008
Posts: 1,848
Re: Javascript OK/Cancel Message Box Example

You Can Check this Code

<html>
<head>
<title>
Test JavaScript Confirm
</ title>

<SCRIPT Language="JavaScript">
<--
securit function ()
(
if (confirm ( 'Do you want to visit the laboratory and Archeology Territory'))
document.location.href = 'Techarena.in'
)
->
</ SCRIPT>

</ head>

<body onLoad="securit()">

Page content
</ body>
</ html>
</ body>
</ html>
Reply With Quote
  #3  
Old 09-06-2009
Member
 
Join Date: Oct 2005
Posts: 2,389
Re: Javascript OK/Cancel Message Box Example

This Code might ALso work

Quote:
<HTML>
<HEAD>
<script Language="JavaScript">
<!--
function checkfields(form)
{
if(confirm("You left some fields empty. Are you sure you want to continue."))
return true;
else
return false;
}
-->
</SCRIPT>
</HEAD>
<BODY>
<TABLE>
<FORM NAME=MyForm ACTION=submit.php3 METHOD="POST" onsubmit="return checkfields
(this);">
<TR><TD COLSPAN="2"><INPUT NAME="submit" VALUE="Submit" TYPE="submit"></TD></TR>
</BODY>
</HTML>
Reply With Quote
  #4  
Old 09-06-2009
Member
 
Join Date: Apr 2008
Posts: 2,001
Re: Javascript OK/Cancel Message Box Example

Hello , Here a the Structure

if (confirm("Your question)) {
// Code to Execute
}


Example

The button above was created using the following code:
<form name=form2>
<input type=button value="Click Here"

onClick="if(confirm('Go Ahead'))
alert('You Went Ahead!');
else alert('You Did not Went Ahead')">
</form>
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Javascript OK/Cancel Message Box Example"
Thread Thread Starter Forum Replies Last Post
How to fix Excel error message cancel editing mode De-Dg MS Office Support 2 24-02-2012 06:50 PM
Cancel a sending text message or MMS in Iphone 4 Atticus Portable Devices 5 27-04-2011 10:27 AM
"Connecting to Printer, Press ESC to Cancel" Message-> Freezes flutura MS Office Support 6 04-10-2010 08:13 AM
How do I cancel a href in javascript? MAHESA Software Development 6 13-05-2010 11:50 PM
Error Message : javascript:void(false) Neel21 Software Development 3 24-08-2009 11:07 PM


All times are GMT +5.5. The time now is 02:07 AM.