0

First of all, I posted this in Joomla Stackexchange because I have created a simple html file and the disabling of the dropdown works.

I have this javascript code right here:

function disable()
 {
   var x = document.getElementById('jform_report');
if(x==null)
    {
        alert('null');
    }
else
    {
        x.disabled = true;
    }       
 event.preventDefault();
}   

I even created this long code just to make sure that I am getting the Id of the dropdown. Which I got successfully. The problem is, the dropdown still remains enabled. I tried this code with other fields such as a textbox. They work except for dropdown lists.

Also, when I use inspect element in the page, this code appears just below the code tag of my dropdown list please see the highlighted area:

enter image description here

3

I think that the problem is in chosen. You are disabling just your select, but chosen renders its content. Please see this question for the possible solution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.