Jquery problem in IE

here is a link to an example:   http://techchorus.net/demos/jquery/hiding-input-elements-in-a-div.html It actually disables several elements of the radio click function.

It works on Firefox, but it only works in IE when you click anywhere on the page. Why is IE not rendering elements in real time like firefox. Please advise.

Thanks here is the code:

<script type="text/javascript"> 
function toggleStatus() {
    if ($('#toggleElement').is(':checked')) {
        $('#elementsToOperateOn :input').attr('disabled', true);
    } else {
        $('#elementsToOperateOn :input').removeAttr('disabled');
    }   
}
</script>


    Click to change: <input id="toggleElement" type="checkbox" name="toggle" onchange="toggleStatus()" />
    </p>
    <div id="elementsToOperateOn">
        This is our example div block. <br />
        Sample Text Box: <input type="text" name="name" /> <br />
        Sample Checkbox : <input type="checkbox" name="participate" /> <br/>
        Sample Radio : <input type="radio" name="bookEarly" /> <br />
        Sample Select: <select name="sampleSelect">
                            <option>Option 1</option>
                            <option>Option 2</option>
                        </select>
    </div>

      

+2


source to share


1 answer


I am assuming IE does not fire the onchange event until the radio element loses focus. You can use the onclick event instead.



+2


source







All Articles