[an error occurred while processing this directive]
[url] rasterweb.net/raster/
[email] pete@rasterweb.net
[pgp key] public key

RasterWeb [More Info]
Home
About
Contact
Archives
Search
Mobile Edition
Kids
Misc
Rambles
Computers
Code

Code:
Code contains bits of text that are probably more interesting to computers than people...


[RasterWeb]

This is a simple JavaScript I use to make someone confirm they *really* want to submit a form. I've needed it a few different times.

Here's the code:


<script language="JavaScript">
<!--
function confirmer () {
  var result;
  result = confirm ("Are you sure you want submit this?");
  return result;
}

//-->
</script>


Here's the form tag:


<form onSubmit="return confirmer()" method="get" action="foo.cgi">

So if you click 'Ok' the JavaScript returns 'true' and the form gets submitted. If not, it's false.

As usual, all the JavaScript warnings are in place, use it as you may...

Here's a sample page.



[top of page]

  Last Modified: 08.17.2000 by rasterboy