jeudi 29 juin 2017

Disabling checkboxes not working correctly

I want to disable 1 box after checking other. Look at the video: http://ift.tt/2sq2fPf

But you can see that there's a little bug: Here's my code:

function disableContentCheckbox(){
            if (document.getElementById('dx_article_excerpt').checked) {
                document.getElementById("dx_article_content").disabled = true;
            } else {
                document.getElementById("dx_article_content").disabled = false;
            }
        }
        function disableExcerptCheckbox(){
            if (document.getElementById('dx_article_content').checked) {
                document.getElementById("dx_article_excerpt").disabled = true;
            } else {
                document.getElementById("dx_article_excerpt").disabled = false;
            }
        }

Why this happens ?




Aucun commentaire:

Enregistrer un commentaire