Enter Key envoking button without being over it

  • Thread starter Thread starter Phillip Kennedy
  • Start date Start date
P

Phillip Kennedy

Hi,

HELP!!!! we are having a problem where we have a web page
with a number of buttons and form fields, unfortunately
whenevr we hit the enter key in a form field it is
envokingthe 1st button, WHY??? this is a major issue for
us please help......
 
Hi Phillip,

Based on my research and experience, I would like to share the following
information with you.

IE has some unexpected behavior when a user presses "Enter" in a textbox.

When a user presses enter with the cursor inside of a textbox, if there is
some kind of a button on the form, IE will automatically post the page.
However, the type of postback depends on how many textboxes are present.

If there is only one textbox, IE will post the page without clicking the
button. In terms of postback data, this means that no post data is sent
for the button. On the server, it looks like the button was never clicked,
and therefore no event handler is fired.

If there is more than one textbox, IE chooses the first button on the form
and magically clicks it. Again, in terms of postback data, this means
postback data is sent for the button, something like "button1=button1" On
the server we detect that the button was clicked and fire the event.

Please tell me what the behavior you really want is. Then we can try to
find a work around.

If I have misunderstood your concern, please feel free to let me know.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Back
Top