Javascript: Pop up Message Box On Submit

Description

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.

<SCRIPT LANGUAGE="JavaScript">
      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.' )
      }
   
</SCRIPT>

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">

</form>
 

More by this Author

  • Gun Laws in Georgia
    38

    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...

  • Tips For How to Stain Concrete Floors
    1

    You don't always have to tile, carpet, or hardwood your floors. The new thing is to just stain the concrete that's already there. It's a lot of work, but if done properly, your home will look gorgeous. If you're...

  • How to Build Wooden Roof Trusses
    23

    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...


Click to Rate This Article
working