G
Guest
Hi,
I'm running into this problem. I want to enable user to submit the form if
'ENTER' is pressed.
The form has two text boxes and a linkbutton.
This is how the code looks like
<BODY onkeydown="javascript:submitForm();">
<form id="Form1" method="post" runat="server">
....
<asp:textbox id="field1" runat="server"></asp:textbox>
<asp:textbox id="field2" runat="server"></asp:textbox>
<asp:linkbutton id="Btn1" runat="server" >Submit</asp:linkbutton>
</form>
</BODY>
....
<SCRIPT language=javascript>
function submitTheForm()
{
if (event.keyCode == 13)
{
__doPostBack("Btn1","");
}
}
</SCRIPT>
Pls ignore any typos. The form submits fine, but there is a sound played on
submit like as if there was an error and I feel its annoying.
Any recommendations/solutions?
Thnx
I'm running into this problem. I want to enable user to submit the form if
'ENTER' is pressed.
The form has two text boxes and a linkbutton.
This is how the code looks like
<BODY onkeydown="javascript:submitForm();">
<form id="Form1" method="post" runat="server">
....
<asp:textbox id="field1" runat="server"></asp:textbox>
<asp:textbox id="field2" runat="server"></asp:textbox>
<asp:linkbutton id="Btn1" runat="server" >Submit</asp:linkbutton>
</form>
</BODY>
....
<SCRIPT language=javascript>
function submitTheForm()
{
if (event.keyCode == 13)
{
__doPostBack("Btn1","");
}
}
</SCRIPT>
Pls ignore any typos. The form submits fine, but there is a sound played on
submit like as if there was an error and I feel its annoying.
Any recommendations/solutions?
Thnx