I used this button to clear the database. It works perfectly:
HTML Code:
<input class="clearButton" type="button" value="Erase Data Now" onclick="clearData()">
However, it would be better to put it in a confirm dialog to prevent accidental use. So I used this line to open a dialog box:
HTML Code:
<input class="clearButton" type="button" value="Clear Data" onclick="confirmation()">
I used this script for the dialog box:

Code:
   <script type="text/javascript">
                        // Confirm Dialog box from http://www.tizag.com/javascriptT/javascriptconfirm.php
                        function confirmation() {
                            var answer = confirm("Are you sure you want to erase ALL data you entered into the fields on this page? Action cannot be undone.")
                            if (answer){
                                onclick="clearData()";
                            }
                            else{
                                onclick="close()";
                            }
                        }
                       
                        </script>
However, the
Code:
onclick="clearData()";
is not firing, but the
Code:
onclick="close()";
works fine, dismissing the dialog box.

How do I incorporate the clearData so it works?

Thanks!