RadioButtonList选择事件onclick

<asp:RadioButtonList ID="rbtnFInvoiceType" runat="server" onclick="checkType()"
RepeatDirection="Horizontal">
<asp:ListItem Selected="True">收据</asp:ListItem>
<asp:ListItem>发票</asp:ListItem>
</asp:RadioButtonList>

 

 


//选择票据类型
function checkType() {
if ($("#rbtnFInvoiceType").find("[checked]").val() == "发票") {
$("#txtFInvoiceCode").attr("readonly", false);
$("#txtFInvoiceCost").attr("readonly", false);
}
else {
$("#txtFInvoiceCode").attr("readonly", true);
$("#txtFInvoiceCost").attr("readonly", true);
$("#txtFInvoiceCode").val("");
$("#txtFInvoiceCost").val("");
}
}

你可能感兴趣的:(RadioButton)