jquery - How to enable or disable a listbox -


how enable or disable listbox control using jquery?

the html code follows:

<div>     <select size="4" name="ctl02$ddlcompensationdates" multiple="multiple" id="ctl02_ddlcompensationdates" disabled="disabled" class="chzn" style="width: 173px; display: none;">         <option value="06/12/2015">06/12/2015</option>         <option value="06/15/2015">06/15/2015</option>         <option value="06/20/2015">06/20/2015</option>         <option value="06/21/2015">06/21/2015</option>     </select>     <div class="chosen-container chosen-container-multi chosen-disabled" style="width: 173px;" title="" id="ctl02_ddlcompensationdates_chosen">         <ul class="chosen-choices">             <li class="search-field">                 <input type="text" value="select options" class="default" autocomplete="off" style="width: 149px;" disabled="">             </li>         </ul>         <div class="chosen-drop">             <ul class="chosen-results"></ul>         </div>     </div> </div> 

i have tried doing following in asp.net page:

$('#<%= ddlcompensationdates.clientid %>').attr('disabled', false);  $('#<%= ddlcompensationdates.clientid %>').focus();  

i resolve issue using below line of code :

$('#<%= ddlcompensationdates.clientid %>').prop('disabled', false).trigger("chosen:updated"); 

Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -