<html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>javascript function for invoking btnclick event</title> <script language="javascript" type="text/javascript"> function TrigButton() { if (window.event.keyCode == 13) { if (document.getElementById('txt').value.length > 0) { document.getElementById('bt').focus(); document.getElementById('bt').click(); } } } </script> </head> <body> <form id="form1" runat="server"> <div> <asp:textbox id="txt" runat="server" onkeydown="TrigButton()"></asp:textbox> <asp:button id="bt" runat="server" text="Button" onclientclick="javascript:alert('Button Triggered');" onclick="bt_Click" /> </div> </form> </body> </html>
Wednesday, February 2, 2011
javascript function for invoking button click event
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment