gpt4 book ai didi

javascript - 无法从 JavaScript 启用按钮

转载 作者:行者123 更新时间:2023-12-01 01:47:43 24 4
gpt4 key购买 nike

<script type="text/javascript"> 
function Enable_Butt() {
document.getElementById("<%=RadButton1.ClientID%>").disabled = false; // Doesn't Work
}
</script>

我也尝试过这个,但仍然不起作用:

$find("<%=RadButton1.ClientID %>").set_enabled(true);

我的代码:

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<telerik:RadButton ID="RadButton1" runat="server" SingleClick="true" SingleClickText="Processing..." AutoPostBack="true" OnClick="Create_Order_Click" Text="Create Order" Font-Bold="true" Font-Size="12" BackColor="#333333" ForeColor="White" Skin="Bootstrap" CssClass="auto-style5" >
</telerik:RadButton>
<asp:Timer ID="Timer1" runat="server" OnTick="Timer1_Tick" Interval="5000" ></asp:Timer>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="RadButton8" EventName="Click" />
<asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
</Triggers>
</asp:UpdatePanel>


protected void Timer1_Tick(object sender, EventArgs e){
ScriptManager.RegisterStartupScript(Page, Page.GetType(), " ", "Enable_Butt()", true);
}

最佳答案

只需完全删除该属性即可。

document.getElementById("<%=RadButton1.ClientID%>").removeAttribute("disabled");

例如,单击 here

关于javascript - 无法从 JavaScript 启用按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51827425/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com