Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    May 2005
    Posts
    262
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Confirm box prevent post

    I have a form that if the user tries to submit without assigning testers, I want it to bring up a confirm box reminding them that there are no testers assigned.

    If they click ok, I want it to post the form. If they click cancel, I want it to prevent the posting of the form and give them the opportunity to attach testers.

    How do I do this?

    Thank you for any help with this.

    Code:
    <SCRIPT LANGUAGE=\"JavaScript\" type=\"text/javascript\">
    
    					function TheFormCheck()
    						{
    
                                                    comfirm(\"Reminder! There are no testers assigned\");
    }
    
    <form name=\"addtask\" method=\"post\" action=\"../admin/tasksubmit.php\" onSubmit=\"return TheFormCheck()\";>

  • #2
    eak
    eak is offline
    Regular Coder eak's Avatar
    Join Date
    Jun 2002
    Location
    Nashville, TN
    Posts
    354
    Thanks
    0
    Thanked 26 Times in 26 Posts
    you need to return the results of the confirm box.


    Code:
    <SCRIPT LANGUAGE="JavaScript" type="text/javascript">
    function TheFormCheck()	{
     return comfirm("Reminder! There are no testers assigned");
    }
    </script>
    eak | "Doing a good deed is like wetting your pants; every one can see the results, but only you can feel the warmth."

  • #3
    Regular Coder
    Join Date
    May 2005
    Posts
    262
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Thank you eak, that worked!


  •  

    Posting Permissions

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