select - jquery value in dropdown selected disable checkbox -
select - jquery value in dropdown selected disable checkbox -
i trying utilize jquery disable checkbox when selected value of dropdown menu other 0. problem when select item 0 value checkbox beingness disabled , checkbox disable have select @ to the lowest degree 2 or more values before disbale checkbox.
an illustration of code here:
example code @ js fiddle
when selected value 0 want checkbox , drop downwards enabled , when selected value other 0 want disable checkbox. work whether start first row, bottom, row, or middle row.
this should it, if understanding of problem correct:
$("select").change(function() { $(this).closest("td").prev().find(":checkbox").prop("disabled", $(this).val() !== "0"); }); $(":checkbox").change(function() { $(this).parent().next().find("select").prop("disabled", this.checked); }); your updated fiddle.
jquery select checkbox drop-down-menu
Comments
Post a Comment