Difference between hitting enter and clicking submit?

Discussion in 'ASP .Net' started by 23s, Feb 22, 2005.

  1. 23s

    23s Guest

    My site's login page has a form w/ 2 textboxes and a submit button. If I'm
    in either of those textboxes (i.e., either one of the textboxes has focus),
    in any given browser, hitting "enter" on my keyboard submits the form.
    Server side, I handle the click event of the submit button. This is the
    expected behavior, and this is the behavior irrespective of what browser I
    use on the login page. However...

    I have different page that is an email submittal form. It has just 1
    textbox and a submit button. On this page, and only when using IE 6.0,
    there is a server-side difference between hitting "enter" as opposed to
    physically clicking the submit button on the client. The difference being
    that if "enter" is used to submit the form, the page performs a postback
    (ispostback = true), but the click event of the button never fires. On the
    other hand, if the button is physically clicked on the client, again
    ispostback=true but now the click event _does_ fire. This is not the
    behavior I was expecting - I expected identical behavior as to my login
    form, where the method of submittal on the client is transparent to the
    server, which should simply believe that submit button was "clicked".

    With other browsers (NN 7.2, FF 1.0, Opera) you can hit "enter" or
    physically click and there is no difference server side (the click event
    fires either way).

    I have gone over the code with a fine toothed comb and cannot find any
    relevant difference between my login form and my email form that would cause
    this behavior (in fact I was not even aware this behavior was possible). Is
    this a known issue of any kind? What exactly should I be looking for here?
     
    23s, Feb 22, 2005
    #1
    1. Advertisements

  2. Steve C. Orr [MVP, MCSD], Feb 22, 2005
    #2
    1. Advertisements

  3. 23s

    23s Guest

    23s, Feb 22, 2005
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.