Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5
  1. #1
    Junior Member
    Join Date
    Aug 2011
    Posts
    5
    Member #
    28915
    hi guys..

    im having a bit of trouble in finding out how to make this work in IE...

    i have a terms check box and a button to sign up below it, the button is disabled until the user checks the terms box...it works in chrome, Mozilla , but not in IE...any ideas...iv heard about an addEvent function, but im not sure how to use it....heres the code

    cheers People!

    if anyone knows it would be great

    <form action='#' onsubmit="signmeup(); return false;">
    <!-- the checkbox -->
    <label for="agree"><span class="agree2"> I agree to the <a href="http://advee.ie/terms">Terms and Conditions</a> </span></label>
    <input type="checkbox" id="agree" value="Yes">
    <br />
    <br />
    <button type="submit" name="signup" disabled style="margin-left:80px;">Sign up</button><br /><br />
    </form>
    <script>
    function is_checked()
    {
    if (this.checked) {
    this.form.signup.disabled = false;
    }
    else {
    this.form.signup.disabled = true;
    }
    }
    //# define event (W3C)
    document.getElementById("agree").addEventListener( "click", is_checked, false);
    </script>
    </div>

  2.  

  3. #2
    Junior Member
    Join Date
    Aug 2011
    Posts
    5
    Member #
    28915
    Quote Originally Posted by ronan clancy, post: 216468
    hi guys..

    im having a bit of trouble in finding out how to make this work in IE...

    i have a terms check box and a button to sign up below it, the button is disabled until the user checks the terms box...it works in chrome, Mozilla , but not in IE...any ideas...iv heard about an addEvent function, but im not sure how to use it....heres the code

    cheers People!

    if anyone knows it would be great

    <form action='#' onsubmit="signmeup(); return false;">
    <!-- the checkbox -->
    <label for="agree"><span class="agree2"> I agree to the <a href="http://advee.ie/terms">Terms and Conditions</a> </span></label>
    <input type="checkbox" id="agree" value="Yes">
    <br />
    <br />
    <button type="submit" name="signup" disabled style="margin-left:80px;">Sign up</button><br /><br />
    </form>
    <script>
    function is_checked()
    {
    if (this.checked) {
    this.form.signup.disabled = false;
    }
    else {
    this.form.signup.disabled = true;
    }
    }
    //# define event (W3C)
    document.getElementById("agree").addEventListener( "click", is_checked, false);
    </script>
    </div>

  4. #3
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,483
    Member #
    425
    Liked
    2783 times
    <input type="checkbox" id="agree" onclick="is_checked()" ondblclick="is_checked()" value="Yes">

    You don't need the listener this way, and you cover the toggling with ondblclick (sometimes a user will click twice rapidly).
    ronan clancy likes this.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  5. #4
    Junior Member
    Join Date
    Aug 2011
    Posts
    5
    Member #
    28915
    Quote Originally Posted by TheGAME1264, post: 216482
    <input type="checkbox" id="agree" onclick="is_checked()" ondblclick="is_checked()" value="Yes">

    You don't need the listener this way, and you cover the toggling with ondblclick (sometimes a user will click twice rapidly).
    I put in your code but the problem persists in IE...the button stays disabled when the checkbox is checked....its driving me nuts!

  6. #5
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,483
    Member #
    425
    Liked
    2783 times
    Try this in your Javascript instead:

    document.getElementById("agree").disabled = (whatever the state is you want).
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)


Remove Ads

Posting Permissions

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

Search tags for this page

disabled button works in ie

Click on a term to search for related topics.
All times are GMT -6. The time now is 05:30 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com