Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Sep 2012
    Thanked 0 Times in 0 Posts

    UI Modal needed...

    What I have is a simply contact form, and when the user hits 'Submit', it needs to pop up with a window asking if the user agrees to disclaimer before the form is sent.
    I know very little about JS, and I've tried searching around the web to find some type of UI Modal (I want to be able to customize the style of it to match the website's theme), but all I can find is a UI Modal that allows you to confirm something, but then just shows the results 'you confirmed it!', or along those lines.

    So basically, something like this:
    User fills out form, clicks Submit.
    Pop up: "Do you agree to the *blah blah blah*?
    if I AGREE - finish submitting the form
    if CANCEL - close pop up window

    If you'd like to look at the contact form, click here and scroll down to it.
    Last edited by pthornt1; 11-02-2012 at 05:12 AM.

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    London, England
    Thanked 2,573 Times in 2,551 Posts
    <form onsubmit = "return agreeterms()">
    Content of form
    <input type = "submit" value = "Submit The Form">
    <script type = "text/javascript">
    function agreeterms() {
    var c = window.confirm ("Confirm that you have read and agree to the terms and conditions");
    if (c) {return true}
    else {
    alert ("You must agree the accept the terms and conditions before you can submit the form");
    return false;
    You can of course create your own modal dialog box using jQuery if you wish.

    Quizmaster: Who is married to the Duke of Edinburgh?
    Contestant: Kate Winslet.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.


    Posting Permissions

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