Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to disable the entire dropdown control in html

Tags:

i see there is a disabled property on a specific item in the dropdown list but is there an enabled property on the whole html dropdown itself?

any suggestions?

like image 345
leora Avatar asked Aug 04 '09 12:08

leora


People also ask

How do you make a dropdown Unclickable?

Add style attribute to DropDownList as style="pointer-events: none; cursor: default;" .

How do I hide the drop-down menu on click outside of the element?

Answer: Use the jQuery on() method You can use the jQuery click() method in combination with the on() method to hide the dropdown menu when the user click outside of the trigger element.

How do you enable disable a dropdown based on value in another dropdown in JavaScript?

prop("disabled", true); } else $("#ddl2"). prop("disabled", false); }); }); The above code will disable the "ddl2" dropdown on select of a particular value in first dropdown.


1 Answers

According to the HTML 4 spec a select element has a disabled attribute.

So

<select disabled>
  <option>Something</option>
</select>

should work

like image 138
Joey Avatar answered Dec 11 '22 21:12

Joey