Click (alert) then submit

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • riteoh
    New Member
    • Jul 2008
    • 2

    Click (alert) then submit

    Hi,

    Only new to javascript., and most of my learning is from browsing for hints - but can't find an answer to this one.

    I have an order form designed for my business, that runs a series of javascript statements for validation etc. However I want to add an event on submission, that comes up with a box confirming the order is about to be submitted once OK is pressed. I figured that I could somehow combine my onsubmit with an onclick, but not exactly sure how to do it. Can somebody help out?

    Thanks
  • maminx
    New Member
    • Jul 2008
    • 77

    #2
    Your necessary is "
    event onsubmit used to show a box dialog to confirm...
    than what your business with onclick event??

    Comment

    • r035198x
      MVP
      • Sep 2006
      • 13225

      #3
      Just treat the confirmation as another validation step and call it as the last of the validation steps the same way you were calling the other validations.

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        If you're calling the validation function in the correct manner, it could look something like this:
        [code=javascript]if (!confirm("what ever confirmation message you want to put here...")) return false;
        return true;[/code]

        Comment

        Working...