jamesh1031
asked on
Submit Button Image and Enter Key
I have this code on my login page where I have a submit button using an image. I want this button to be activated if a user presses their Enter Key.
How would I accomplish this?
<td align="center">
<input type="button" runat="server" onserverclick="DoLogin" ID="Submit1" NAME="Submit1"
style="BORDER-RIGHT: 0px solid; PADDING-RIGHT: 0px; BORDER-TOP: 0px solid; PADDING-LEFT: 0px; BACKGROUND-IMAGE: url(../CSS/Buttons/submit_ plain.gif) ; PADDING-BOTTOM: 0px; BORDER-LEFT: 0px solid; WIDTH: 132px; PADDING-TOP: 0px; BORDER-BOTTOM: 0px solid; BACKGROUND-REPEAT: no-repeat; HEIGHT: 15px"></td>
How would I accomplish this?
<td align="center">
<input type="button" runat="server" onserverclick="DoLogin" ID="Submit1" NAME="Submit1"
style="BORDER-RIGHT: 0px solid; PADDING-RIGHT: 0px; BORDER-TOP: 0px solid; PADDING-LEFT: 0px; BACKGROUND-IMAGE: url(../CSS/Buttons/submit_
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You might want to do something like following:
<body onkeydown="if(event.keyCod e == 13){document.getElementByI d('ImageBu tton1').cl ick();}">
...
<asp:ImageButton id="ImageButton1" runat="server"></asp:Image Button>
-tushar
<body onkeydown="if(event.keyCod
...
<asp:ImageButton id="ImageButton1" runat="server"></asp:Image
-tushar
https://www.experts-exchange.com/questions/20944907/ASP-NET-Default-button-when-user-hits-Return.html