我有一个链接按钮
<asp:LinkButton ID="_addToCartButton" runat="server" CssClass="button"
OnClick="AddToCartClick" OnClientClick="Disable();" ValidationGroup="AddToCartRetail">
<span>Add To Cart</span>
</asp:LinkButton>
和我的javascript
function Disable() {
document.getElementById("_addToCartButton").setAttribute("disabled", "disabled");
}
请帮我禁用此链接按钮
答案 0 :(得分:0)
将您的链接按钮写为:
<asp:LinkButton runat="server" ID="lnk" Text="Submit" OnClientClick="return test(this);"
OnClick="lnk_Click"></asp:LinkButton>
并将java脚本编写为:
<script type="text/javascript">
function test(obj) {
obj.disabled = true;
return false;
}
</script>