Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 4 of 4
  1. #1
    Member jnunemaker's Avatar
    Join Date
    Jan 2004
    Location
    IN
    Posts
    44
    Member #
    4532
    I have a form with one text field. The page is set to autofocus on that text field when it loads. If the user enters text in to the text field, and hits enter, the value will show in the query string if I use the get method, and the text field is cleared as if the form were submitted, however, the form does not get submitted. If you add another text field so that you have two, then set the focus to the first text field, when the user enters text and immediately hits enter without tabbing to the next field or clicking the submit button with the mouse, the form submits. The form only doesn't submit if there is one text field, set to autofocus, and the user hits enter immediately after entering text in that lone field, without clicking enter with their mouse or tabbing to the submit button and hitting enter. Also, the form works fine in mozilla firefox. It just doesn't work in IE. IE is the required browser at my company, so it has to work there. Any ideas? Did that make sense the way I explained it? If not I can explain better. Thanks, John
    JohnNunemaker.com
    “Limitations are the soil from which creativity grows.” - Zeldman
    Get Firefox | PHP | CSS | XHTML

  2.  

  3. #2
    Senior Member teal's Avatar
    Join Date
    Dec 2003
    Posts
    247
    Member #
    4319
    Little hard to see what you mean, could you link?
    Whoth steps forth to mock the teal? Whom couldst say a color superior!

    Proclamith me, it cannot be done.

  4. #3
    Senior Member glyakk's Avatar
    Join Date
    Nov 2003
    Location
    USA
    Posts
    1,263
    Member #
    3828
    Liked
    6 times
    Trying to clarify, I think.
    So you are saying that if you have only one field in a form and have it set to autofocus so when you go to that page its selected automatically, and then start immediatly typing text into the field then press enter to 'submit' the form instead of using the mouse or tabbing to it first, the form flakes out?


  5. #4
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,483
    Member #
    425
    Liked
    2783 times
    John,

    The behaviour that you are experiencing is indeed IE-specific. Why it happens, I'm not 100% sure. The only way I've seen to get around this particular issue is to disable the submit button by default and use JScript to only enable the button when the required information is filled in.

    Something like this (pseudocode):

    Script:

    validate function {
    (insert validation here; if validation check passes, submit button is enabled; else, button is disabled).
    }

    Page itself:

    <input field onChange=(validate function) onBlur=(validate function)>

    Another thing that can work is to have two submit buttons. IE, on Enter, can't distinguish which button to use, and as such will usually not do anything.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 10:58 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com