stuck for hours

javascript Canada
  • 18 years ago

    I want have a page where the user read an agreement and clicks a checkbox, when submitted if the checkbox is check then navigate to next page if check box not checked an alert pops up saying the must check  the checkbox before joining this is what i have but cant seem to call the function browser navigates to click() instead of calling function click()

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
             
     <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
     <title>Pleasure Palace Sign up Agreement</title>
         
     <meta name="author" content="Robert Weatherall">
     
     <meta name="description" content="Pleasure Palace Sign up Agreement">



    <SCRIPT LANGUAGE=javascript>
    <!--
    function check()
       {
       if(document.GetElementById('agree').checked)
       {
       document.location=("http://www.myleague.com/php/page.php?p=signup&t=myleague&lng=eng&l=pep&g=classic&svr");
       }
       
    else
       {
            alert("You Must Accept Agreement to become a Member.");
            return false;
       }
    }
    //-->
    </SCRIPT>





    </head>
    <body text="#00cccc" bgcolor="#ffffff" link="#ff0000" vlink="#551a8b" alink="#0000ee" background="http://www.geocities.com/p_palace2003/greenback.gif">


    <div align="Center"><b><img src="http://www.geocities.com/p_palace2003/pleasurepalace.jpg" alt="Pleasure Palace" width="313" height="232">


    agreement here


    <center><table  class=table width=100%><td><form method="post"  action="check()" name="pepagreement">
    <tr><td align=center colspan=2>Check if you Accept Agreement: <INPUT TYPE=checkbox id="agree"></td></tr>
    <tr><td cellpadding=0 colspan=2><center><INPUT TYPE=submit VALUE=Continue  ></td></tr></table></td></FORM></table>
    </td></table>



     


    </body>
    </html>

  • 18 years ago

    you're close...


    one thing though <lol> , are you running a porn site or
    something? what the heck is the "pleasure palace"?!?

  • 18 years ago

    am I close or way off? caan you help?
    its not a porn site lol it is a euchre league lmaowww.myleague.com/pep
    please help

  • 18 years ago

    ah, ok.


    1) change your form tag from <form ...> (where "..." is the
    other stuff in it) to just simply <form>


    2) Change your submit button to include the following:
    <input type=submit ... onClick="check();" ...>


    And then it should work!

  • 18 years ago

    ok what i had to do was change input type submit to button, cuz i was not submitting nething, i wanted to just call a function

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Computer science education cannot make anybody an expert programmer any more than studying brushes and pigment can make somebody an expert painter” - Eric Raymond