Skip to content Skip to sidebar Skip to footer

Tick Checkbox Then Submit And Then Pop Up Window

I will appreciate if somebody could help me to find how to solve out one problem, probably I need very simple thing but I don't know how to put it in one, so what I need - Section

Solution 1:

"f you tick and push button should smoothly appear pop up window with just text information" - you've almost did it. Just add alert to the second branch. Try this code:

<!DOCTYPE html>
<html>
  <!-- [[[ head -->

  <head>
    <title>element</title>
<script type="text/javascript">
  function checkme() {
        if (!document.form.agree.checked) {
            missinginfo = "You must agree to the Terms and Conditions\n Please tick the box and try again.";
            alert(missinginfo);
            return false;
        }
        else {
            alert("Text information");
            return true;
        }
    }
</script>
  </head>
  <!-- ]]] -->

  <body>
    <form name="form" method="post" action="#" onSubmit="return checkme();">
      <input type="checkbox" name="agree" id="agree" value="agree_terms" class="terms">
      <label for="agree">&nbsp;I&acute;ve read terms and conditions and I&acute;m ready to shop</label>
      <input type="submit" name="submit" value="Submit" class="submit">
    </form>
  </body>
</html>

Post a Comment for "Tick Checkbox Then Submit And Then Pop Up Window"