Author: whagar | Posted on: 12/12/2008 9:25:18 AM | Views : 377

I am having an issue with an onblur textbox event when the Enter key is used to submit the form (which I hope not to have to disable).

Consider the example code below in it's simplest form:

Onblur of the first textbox text is inserted into the second textbox.

When using the Submit button all is fine, onblur gets fired, the page posts back and the modified text is present after postback.

When placing the cursor in the first textbox and pressing the ENTER key, onblur writes text to the second textbox and posts back but the written text disappears when returning from postback, like it never made it into the viewstate.

I've tried capturing the ENTER key (onkeydown) and manually changing the focus then calling the button click event.  I've tried setting default button (this is ASP.NET 2.0).  I can't think of anything else to try.  This really needs to be in an onblur event (although onchange does the samething an ...

Go to the complete details ...