SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Feb 2008
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ToS click to accept almost perfect, please help :)

    i used an answer from another post,

    <script type="text/javascript">
    function validate() {
    var tos = document.getElementById("tos");
    if (tos.checked) alert("TOS agreed to - whatever logic at this branch");
    else alert("You must agree to our Terms of Service");
    }
    </script>

    <form onsubmit="validate();">
    <input type="checkbox" id="tos"> Do you agree to our Terms of Service?
    <p>
    <input type="submit" value="Register">
    </form>



    and it works very nearly perfectly for what i need, except how do i get this line...


    if (tos.checked) alert("TOS agreed to - whatever logic at this branch");

    to go to a url instead

    also, if anyone knows how to get this done with HTML instead, that would be great

    thank you in advance

  2. #2
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,806
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    Hi and welcome to the forums

    To get to another location, use
    Code:
    window.location="http://someplace.com"
    in place of the alert.
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....


Bookmarks

Posting Permissions

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