我正在尝试使用 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>