www.webdeveloper.com
Results 1 to 3 of 3

Thread: Radio buttons not shown correctly after checking on checkboxes in IE8

  1. #1
    Join Date
    Jan 2010
    Posts
    2

    Radio buttons not shown correctly after checking on checkboxes in IE8

    I have a group of 2 radio buttons and you can only choose one of those (mutually exclusive). Below it, there are 2 independant checkboxes. If you check on any one of the checkboxes, then the 2nd radio button should be selected. This works in Firefox, but not in IE8. The only way the radio button will be updated is when you check on both of the checkboxes, or checking on one of those and then mouseclick on anywhere on the page.

    The problem seems to be that the radio buttons just aren't updated correctly before submitting the form. After submitting, the correct choices are selected.

    Anyone encountered the same problems?

    Here are the javascript functions:

    function chooseRolle() {
    document.forms[0].hasRoles[1].checked = true;
    }
    function chooseAll() {
    for (i=0;i<document.forms[0].roles.length;i++) {
    document.forms[0].roles[i].checked = false;
    }
    }

  2. #2
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    What is the html?
    At least 98% of internet users' DNA is identical to that of chimpanzees

  3. #3
    Join Date
    Jan 2010
    Posts
    2
    I found a workaround for IE8. It will work using onclick instead of onchange. Is this a bug?

    <input id="all" name="hasRoles" class="radioButton" onclick="chooseAll();" type="radio" value="false" checked="checked"/>


    <input name="roles" class="checkbox" onclick="chooseRole();" type="checkbox" value="ARE=IMPORT"/>


    <input name="roles" class="checkbox" onclick="chooseRole();" type="checkbox" value="ARE=USER"/>

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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