Javascript: Pop up Message Box On Submit


In this Javascript example, when the user hits the submit button on an order form, a windows style dialog message box pops up, with some disclosure information before the user continues to the next web page.

This process is basically a "Confirm" notice to the user. To make sure the user is responsible for the data being passed. Its a way to put the ownership on the user to verify the data again before submitting.

Javascript Code

Below is the javascript example, to be placed between the <HEAD></HEAD> tags of the document with the submit button.

      function confirmAction() {
        return confirm('Attention:\nPlease be sure to carefully review your information for typos, as well as proper\ncapitalization, punctuation, sentence case, etc. We do not evaluate or verify the accuracy of\nany and all information entered by the user, and therefore shall not be responsible or liable for said accuracy.' )

HTML Form Code:

Below is the HTML/Javascript call for the diaglog message box to display when the form is submitted.

<form action="nextpage.html" method="post" target="_top" name="submitform" onSubmit="return confirmAction()">

<input type="submit" value="Checkout" name="sub">


More by this Author

  • Gun Laws in Georgia

    Firearms can be a very dangerous tool in the hands of the wrong person. Every state has their own gun laws and regulations. For the state of Georgia, the laws are pretty straight forward and easy to abide by. Before you...

  • How to Build Wooden Roof Trusses

    You may refer to a truss as the rafter, but it's basically the skeleton of the roof, carrying the weight of the frame and supporting the walls of the building. Trusses are very important to preventing the walls from...

  • How to Get Rid of Mice In and Around The House?

    Until this year, the only time that I've had mice or rats in the house were when my daughter had pet mice and rats, and one of those times we did have one loose in the house. (Science fair project got loose.) Anyway,...

Click to Rate This Article