提交后重新启用按钮
问题描述:
我正在采用与当前的工作方式是生成一个文件并将其返回给客户端,但是在返回文件后,该按钮应再次变为活动状态. 因此响应中包含该文件.但是该按钮不会重新激活.
How this currently works is that a file is generated and returned to the client, however after the file is returned the button should become active again. so the response contains the file. But the button does not reactivate.
我不确定是否可以做到. 有什么想法吗? 谢谢
I'm not certain if this can be done. Any thoughts? Thanks
答
您可以将按钮的ID模式设置为静态.然后为按钮选择一个唯一的ID.只要您验证文件已成功传输,就可以调用(jquery):
You could set the Id mode of the button to static. Then choose a unique Id for the button. Whenever you have verified that the file is successfully transmitted you can call (jquery):
$("#idOfSubmitButton").attr("disabled", false);