jquery - Enable/Disable using Radio is not working -


i trying disable/enable dropdown box based on user selection of radio buttons. have following jsfiddle: jsfiddle works fine on it's own.

$('input[type=radio]').click(function() {     var r_id = $("input[@name=sc]:checked").attr('id');     alert(r_id);      if (r_id == "bname") {         //enable name drop down         $(".dname").prop('disabled', false);         //disable specialty drop down         $(".dspecialty").prop('disabled', true);     }     if (r_id == "bspecialty") {         //enable specialty drop down         $(".dspecialty").prop('disabled', false);         //disable name drop down         $(".dname").prop('disabled', true);     } }); 

the same exact code in following page not working: website demo

i ran code on local xampp server. appears the issue coming chosen.jquery.js file. if remove script example.jquery.html intended behavior.

what's happening start out <select> tag options js works fine for. chosen.jquery.js creates <div> block in place of <select> tag. 'disabled' property no longer applies newly built <div> block.

reference: how should disabled <div> act?

this chosen.jquery.js file looks third party custom drop down box. not sure if functionality there disable this, need check api. if not need create custom css class div make appear faded.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -