我正在尝试使用Javascript在我的jQuery UI对话框中禁用ddl(ddlGender),但它不起作用,也尝试从代码隐藏,请咨询。感谢:
function loadDialog() {
var gender = $('#<%=litGender.ClientID %>').val();
if (gender != '') {
alert('true');
$('#<%=ddlGender.ClientID %>').disabled = true;
}
$('#DialogBox').dialog('open');
}
<div id="DialogBox" title="">
<span>Gender:</span><asp:DropDownList ID="ddlGender" runat="server" AutoPostBack="True"
onselectedindexchanged="ddlGender_SelectedIndexChanged">
<asp:ListItem Text="Both" Value="" Selected = "True"/>
<asp:ListItem Text="Male" Value="m"/>
<asp:ListItem Text="Female" Value="f" />
</asp:DropDownList>
</div>