I see about getting the button name..
Lets change this just a bit... Completely ignore the "ENTER" key from within the range of the textbox control... so NO submit is actually processed... How would you change the script for no default "ENTER" type behavior.
>>I have a webform with a grid... When user does the "select" record and it goes to edit mode, when the user enters the value and hits enter, the "default" button on the form is a link to another page instead of the "update" or "cancel" buttons... How can I force the default button during an "edit" mode.
>
>There's no concept of a default button in HTML so there's no automatic way to do this. The only way that you can do this realistically is use some java script and monitor keystrokes, then when you get an Enter key 'click' the appropriate button.
>
>Something like this:
>
>< script >
>function SubmitOnEnter(event)
>{
> if ( event.keyCode == 13 )
> document.getElementById('btnSubmit').click();
>
>}
></ script >
>
>
>which you can then call from any control that should submit on enter with:
>
>
><asp:TextBox runat="server" id="txtName" onkeyup="SubmitOnEnter(event)" />
>
>
>Little more work is required to get the name of the submit button though <s>...