www.webdeveloper.com
Results 1 to 3 of 3

Thread: [RESOLVED] Checkbox

  1. #1
    Join Date
    Nov 2011
    Posts
    23

    resolved [RESOLVED] Checkbox

    The code below is executed when a checkbox (A0) is clicked on, however it causes the checkbox to not be checked and doesn't change when it's clicked on again. Why is this?

    Code:
    if (document.getElementById("courseA0").checked = false) {
    		document.getElementById("courseM0").disabled = false;
    		document.getElementById("courseG0").disabled = false;
    }

  2. #2
    Join Date
    Oct 2010
    Location
    Versailles, France
    Posts
    1,270
    Change the test with a comparison operator (==) and not an assignment operator (=) !
    Code:
    if (document.getElementById("courseA0").checked == false) {
    		document.getElementById("courseM0").disabled = false;
    		document.getElementById("courseG0").disabled = false;
    }
    Last edited by 007Julien; 10-23-2012 at 07:45 PM.

  3. #3
    Join Date
    Nov 2011
    Posts
    23
    Thank you.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles