I have a javascript function which I want to send a ASP button control. So my function is like this:
<script type="text/javascript">
function PreventKeyPress(e, sender, button) {
//do something with the button
button.click();
}
</script>
From the ASP markup I want to be able to pass the button in. I've tried a few ways but this is something like I'd want to do:
<asp:TextBox ID="textBoxDate" runat="server" onKeyDown="PreventKeyPress(event, this, <%=buttonDate.ClientId %>);" />
<asp:ImageButton ID="buttonDate" runat="server" />
Any ideas how I can get this to work?