1. Add a new hidden button. Make sure its diplay is none. set its width and height be same with the submit button.
<input id="btnSubmitHide" type="button" value="Submit&Next" style="display: none; width: 120px" />
<asp:Button ID="btnSubmit" runat="server" OnClick="btnSubmit_Click" Text="Submit&Next" Width="120px" OnClientClick="return SubmitAllInfo();" />
2. Add a js function.
function DisableSubmitButton() {
document.getElementById('MainContent_btnSubmit').style.display = 'none';
document.getElementById('btnSubmitHide').style.display = '';
document.getElementById('btnSubmitHide').disabled = true;
document.getElementById('btnSubmitHide').width = '120px';
}
3. Add the function to the submit button's OnClientClick.
4. Change the hidden button's display be normal. then you can check the two buttons in page. make sure there is no space between them. then change the display to be none. it is better to write them as a line.
<input id="btnSubmitHide" type="button" value="Submit&Next" style="display: none; width: 120px" /><asp:Button ID="btnSubmit" runat="server" OnClick="btnSubmit_Click" Text="Submit&Next" Width="120px" OnClientClick="return SubmitAllInfo();" />
本文介绍了一种在网页中隐藏提交按钮的方法,通过使用HTML和JavaScript实现。具体步骤包括:添加一个隐藏按钮并设置其样式与提交按钮一致;添加JavaScript函数以在点击提交按钮时隐藏它并禁用隐藏按钮;最后修改隐藏按钮的显示属性以确保页面布局的一致性。
5930

被折叠的 条评论
为什么被折叠?



