ArtsAutosBooksBusinessEducationEntertainmentFamilyFashionFoodGamesGenderHealthHolidaysHomeHubPagesPersonal FinancePetsPoliticsReligionSportsTechnologyTravel
  • »
  • Technology»
  • Computers & Software»
  • Computer Science & Programming»
  • Programming Languages

Javascript: Pop up Message Box On Submit

Updated on August 24, 2012


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



Submit a Comment

No comments yet.