not sure if I've missed something with the problem, but I have a textbox on my form and everytime I hit enter, the form would accept the changes to the yexybox and process the order.
My solution was to include a 'fake' button that did nothing, something like this
I set visible=false at first but that didn't seam to work, so setting everything to the same colour as the background (i.e. white in my case) and that did the trick.
jakenet
Member
2 Points
1 Post
Re: ASP.NET 2.0 - Enter Key - Default Submit Button
Oct 08, 2011 02:40 PM|LINK
Hi everyone
not sure if I've missed something with the problem, but I have a textbox on my form and everytime I hit enter, the form would accept the changes to the yexybox and process the order.
My solution was to include a 'fake' button that did nothing, something like this
<form id="form1" runat="server" defaultbutton="btnfake">
<asp:Button ID="btnfake" runat="server" Width="0px" Height="0px" BorderColor="White" BackColor="White" text="" ForeColor="White" BorderWidth="0px"/>
I set visible=false at first but that didn't seam to work, so setting everything to the same colour as the background (i.e. white in my case) and that did the trick.
Hope that all makes sense.
Mick