Results 1 to 2 of 2

Thread: submit question

Hybrid View

  1. #1

    Thread Starter
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945

    submit question

    How do I ask the user if they want to submit a form or not? And if they say no, I want to stop anything from happening.
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

  2. #2
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    I don't think JavaScript has the ability for a Yes/No type of prompt box. You could use a prompt box and have them type in Yes or No, but that's not very cool.

    Maybe someone else will have a better answer, but here's the prompt() thing:

    Code:
    <html>
    <head>
        <title></title>
        <script type="text/javascript">
            function confirm() {
                var res = prompt('Submit This Form? (yes or no)', 'Yes');
    
                if (res == 'yes' || res == 'Yes') {
                    return true;
                } else {
                    return false;
                }
            }
        </script>
    </head>
    <body>
        <form action="this.php" method="post" onsubmit="return confirm();">
            <input type="submit" name="submit" value=" Submit " />
        </form>
    </body>
    </html>
    My evil laugh has a squeak in it.

    kristopherwilson.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width