Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Confirm Question

Status
Not open for further replies.

dtfhome

Programmer
Oct 2, 2002
4
US
I am new with javascript and would like a message to pop up upon submit.

I would like to display the message

Are you sure you want to submit?

I would like the options to be 'yes' and 'no'.

If yes then proceed with submit and if no, then cancel submit.

Any suggestions are welcome.

Thanks in advance.
 
Hi dtfhome, see if this helps you:


<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>

<script type=&quot;text/javascript&quot;>
function send() {
var ans = confirm (&quot;Are you having fun?&quot;)
if (ans) {
window.location=&quot; return false;
}
else {
window.location=&quot; return false;
}
}
</script>
</head>

<body>
<form>
<input type=&quot;submit&quot; onClick=&quot;return send();&quot;
</form>
</body>
</html>
Forget the Nobel Peace prize, I just want to take over the world!! [hammer]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top