Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
250
How to disable Webdropdown using javascript
posted

Can someone please tell me how to disable and enable the dropdown in javascript. I don't need to cancel the value changed event or just give the appearance of being disabled, I really need it disabled, and the ability to enable it again. I need the control to be disabled\enabled when other controls on the page perform certain actions. I don't see why this has to be so hard. The help for the CSOM for the new AJAX controls is so poor in comparison to the help for the old controls it is laughable.

  • 24671
    Suggested Answer
    posted

    Hi, 

    It's actually pretty easy:

    var dropDown = $find("WebDropDown1");

    dropDown.set_enabled(false);

    dropDown.set_enabled(true);

    that's from the client-side. you will need to use the latest service release. (Please let me know if this is not working in the latest service release). 

    From the server-side, you can set Enabled property to false.

    Also you can set DropDownMode=DropDownList or ReadOnly, if you just don't want to allow editing during runtime.

    Hope it helps,

    Angel