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 5 of 5
  1. #1
    New Coder
    Join Date
    Sep 2002
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Accept Terms script, doesnt work on Firefox...help please!

    Hi everyone,

    I have used the script below for our website:

    <SCRIPT language=JavaScript>
    <!--

    //Accept terms & conditions script (by InsightEye www.insighteye.com)
    //Visit JavaScript Kit (http://javascriptkit.com) for this script & more.

    function checkCheckBox(f){
    if (f.agree.checked == false )
    {
    alert('Please check the box to continue.');
    return false;
    }else
    return true;
    }
    //-->
    </SCRIPT>

    <form action="/test.html" method="GET" onsubmit="return checkCheckBox(this)">

    I accept: <input type="checkbox" value="0" name="agree">
    <input type="submit" value="Submit form">
    </form>


    It is based on this script: http://www.javascriptkit.com/script/...ept_term.shtml.

    Both scripts work fine on IE but can't I get them to work on Firefox. On IE the script takes the user to designated page as long as the checkbox is ticked. But on Firexfox it does nothing!

    Any ideas would be appreciated !

    thanks,

    Tony

  • #2
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts
    I'm no javascript guru, but I tested the code you posted and it worked just fine (FF 1.0 on OS X). Perhaps you should post the rest of your code (in code tags) in case there is something else relevant to your problem...

  • #3
    teh Moderatorinator
    Join Date
    Sep 2004
    Location
    USA
    Posts
    2,472
    Thanks
    4
    Thanked 40 Times in 40 Posts
    take out the red slash...<form action="/test.html" method="GET" onsubmit="return checkCheckBox(this)">
    Edit: nevermind...i was thinking of something else...
    Last edited by Brandoe85; 12-10-2004 at 08:46 AM.

  • #4
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    Try:

    if (!f.agree.checked)
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #5
    New Coder
    Join Date
    Sep 2002
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks guys!,

    Brandoe85...removing the slash worked...i feel a bit stupid!

    regards,

    Tony


  •  

    Posting Permissions

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