[thelist] JAVASCRIPT: confirmation dialog box that actually works!

James Aylard evolt at pixelwright.com
Thu Aug 29 12:00:01 CDT 2002


David,

> Give this a try:
>
> <form action="" method="POST">
> <input type="Button" value="Test" id="myButton" onClick="validate()">
>
> <script language="JavaScript">
>
> function validate()
> {
> conf = confirm("Are you sure?");
> document.write(conf);
> }
>
> </script>
> </form>

    But this does nothing to cancel the form submission. To do that, you
need to return false in the onsubmit event of the form.

James Aylard




More information about the thelist mailing list