如果布尔变量为 true,则禁用按钮
我发现主题涵盖禁用按钮以避免提交两次(假设这可以通过 javascript 完成),但我需要的是如果数据库中的字段“formSubscribed”保持真实值,则禁用提交按钮。否则,这意味着该表格尚未提交,需要进行此提交。知道如何做到这一点吗?
<asp:TableCell>
<asp:Button id="acceptButton" Text="Accept" runat="server" OnClick="Click"/>
<asp:Button id="declineButton" Text="Decline" runat="server" OnClick="DeclineRequest"/>
</asp:TableCell></asp:TableRow></asp:Table></form></asp:Content>
所以如果 formsubmited 变量成立,我想禁用接受和拒绝按钮。 再次感谢,
I've found topics covering disabling buttons to avoid submitting twice (assuming this could be done via javascript), but what i need is to disable button of submit if field "formSubmitted" in the database holds true value. otherwise this means the form has not been submitted and this submit is required. Any idea how to do this?
<asp:TableCell>
<asp:Button id="acceptButton" Text="Accept" runat="server" OnClick="Click"/>
<asp:Button id="declineButton" Text="Decline" runat="server" OnClick="DeclineRequest"/>
</asp:TableCell></asp:TableRow></asp:Table></form></asp:Content>
so yeh the accept and decline buttons are what i want to disable if formsubmiited variable holds true.
Thanks again,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
使用已启用属性。
Use the Enabled property.
尝试这样的事情:
或者
Try something like this:
Or
你也可以尝试
You can also try