Be seen. Boost your question’s priority for more expert views and faster solutions
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>hideButton</title>
<script type="text/javascript">
<!--
function hideButton()
{
// hide div
document.getElementById('theButton').style.visibility = 'hidden';
document.getElementById('theButton').style.display = 'none';
// do other stuff here
}
// -->
</script>
</head>
<body>
<div id="theButton">
<input type="button" onclick="hideButton()" value="Click Me" />If you click this button, it will disappear.</div>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>hideButton</title>
<script type="text/javascript">
<!--
function hideButton()
{
// hide div
var loadgif = "<img alt='x' src='progressbar_green.gif' />";
document.getElementById('theButton').innerHTML = loadgif;
// do other stuff here
}
// -->
</script>
</head>
<body>
<div id="theButton">
<input type="button" onclick="hideButton()" value="Click Me" />If you click this button, it will disappear.</div>
</body>
</html>
Right click on the image and download it.<asp:Button ID="btnSubmit" runat="server" Text="Save & Submit - Tom" OnClick="btnSubmit_Click" />
I think for it to work properly, you need to put it in an 'onsubmit' in the <form> tag. Not in an 'onclick' in the submit button.
<script type="text/javascript">
$(document).ready(function () {
$('input [id*="btnSubmit"]').click(function () {
$(this).hide();
// alert("hide");
});
});
</script>
<<td>
<span id="ctl09_spnSubmitBtn" class="button">
<input type="submit" name="ctl09$btnSubmit" value="Save & Submit - Tom" id="ctl09_btnSubmit">
</span>
</td>
I'm curious what that looks like in the "View Source" that the browser actually sees.
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
From novice to tech pro — start learning today.
How to disable an ASP.NET button when clicked:
http://weblogs.asp.net/jeffwids/archive/2009/10/06/how-to-disable-an-asp-net-button-when-clicked.aspx
Hide a submit button when clicked and show loading message using jQuery and asp.net:
http://reddybrek.com/post/Hide-a-submit-button-when-clicked-and-show-loading-message-using-jQuery-and-aspnet.aspx
http://forums.asp.net/t/1371974.aspx