Re: OnClientCLick problem
try changing
OnClientClick="return showSending(this.id)"
to
OnClientClick="showSending(this.id)"
at a guess this is a file upload message so that should work.
Re: OnClientCLick problem
Unfortunately that doens't work. Once the button is clicked the onClick event still isn't being fired.
Re: OnClientCLick problem
This is a message that should appear after a file is attached to an message then emailed.
I just need a message to appear after the button click. ANy idea's how to get the server side code to fire?
Re: OnClientCLick problem
If the source of the submit is disabled, i.e. your button, the page won't submit. Simply delaying the disable for a tad may work:
Code:
function showSending(button) {
window.setTimeout("button.disabled = true", 50);
var linkID = document.getElementById("sending");
linkID.style.visibility = "visible";
return true;
}
</script>
<asp:Button ID="btnSending" runat="server" Text="Sending" OnClientClick="return showSending(this)" OnClick="btnSending_Click" />
<div id="sending" style="border: solid 1px green; padding: 5px; width:55px; font-family:Verdana; font-size:12px; visibility:hidden;">Sending..</div>
Re: OnClientCLick problem
I tried this but i get the following error:
'Microsoft JScript runtime error: 'button' is undefined'
Re: OnClientCLick problem
The OnClientClick property changed to "return showSending(this)"
Re: OnClientCLick problem
I couldn't get it working the way i wanted it to so i had to set the button visibility to hidden once it was clicked.
It does the same job which is preventing the user from clicking the button again so i'm not complaining.
Thanks.
Re: OnClientCLick problem
am I missing something or is showsending JS function not returning a value, which would make it return false always?
Re: OnClientCLick problem
Quote:
Originally Posted by kleinma
am I missing something or is showsending JS function not returning a value, which would make it return false always?
Originally, yes, but the version I posted was explicit in its return
Re: OnClientCLick problem
Didn't see your post there. At least we are on the same thought ;)