HTML代码:
<select name="brand" style="width: 150px ; height : 20px;" class="easyui-combobox" id="brand"> <option ${img.brand == 'CHEVROLET' ? selected:'' } value="CHEVROLET">CHEVROLET/雪佛兰</option> <option ${img.brand == 'BUICK' ? selected:'' } value="BUICK">BUICK/别克</option> <option ${img.brand == 'CADILLAC' ? selected:'' } value="CADILLAC">CADILLAC/凯迪拉克</option> </select>
JS代码:
$(function(){ $("#isDefault").combobox({ onChange: function () { ckselect() ; } }); });
function ckselect() { var isdef = $("#isDefault").val(); if(isdef == 'Y'){ $("#model").attr("readonly", "readonly"); $("#modelYear").attr("readonly", "readonly"); }else{ $("#model").removeAttr("readonly"); $("#modelYear").removeAttr("readonly"); } }