Loading ...
Sorry, an error occurred while loading the content.

AutoComplete submits entire form when enter is pressed on OSX

Expand Messages
  • thespursfan29
    The autocomplete is working great on windows xp with firefox 2 and ie 7. When I went to test my page out in safari and firefox on mac osx, I ran into a
    Message 1 of 2 , Jan 3, 2007
    • 0 Attachment
      The autocomplete is working great on windows xp with firefox 2 and ie 7.
      When I went to test my page out in safari and firefox on mac osx, I
      ran into a problem.

      When I start typing in a letter to my autocomplete text field, and
      then it comes up with a match, on windows I press enter on my keyboard
      and it pulls that value into the text field (typing "te" highlights
      "test" in the div of choices, and then I hit enter and "test" is now
      in my textfield).

      But on mac in safari and firefox, when I hit enter in this scenario,
      it submits the entire form which I do not want.
      This also happen when I click on the result instead of hitting enter.

      Is there a bug since it works great on windows but not well on mac osx?
      It could also be my code.

      Any help on this would be appreciated.
    • jennykhan
      Hi there, Can you post a link to the page, or paste in the entirety of the code? You might need to add some code to prevent automatic form submission. The code
      Message 2 of 2 , Jan 29, 2007
      • 0 Attachment
        Hi there,

        Can you post a link to the page, or paste in the entirety of the code?
        You might need to add some code to prevent automatic form submission.
        The code here is just one example of how you might accomplish that:
        http://developer.yahoo.com/yui/examples/autocomplete/ysearch_json.html.

        Regards,
        Jenny



        --- In ydn-javascript@yahoogroups.com, "thespursfan29"
        <thespursfan29@...> wrote:
        >
        > The autocomplete is working great on windows xp with firefox 2 and ie 7.
        > When I went to test my page out in safari and firefox on mac osx, I
        > ran into a problem.
        >
        > When I start typing in a letter to my autocomplete text field, and
        > then it comes up with a match, on windows I press enter on my keyboard
        > and it pulls that value into the text field (typing "te" highlights
        > "test" in the div of choices, and then I hit enter and "test" is now
        > in my textfield).
        >
        > But on mac in safari and firefox, when I hit enter in this scenario,
        > it submits the entire form which I do not want.
        > This also happen when I click on the result instead of hitting enter.
        >
        > Is there a bug since it works great on windows but not well on mac osx?
        > It could also be my code.
        >
        > Any help on this would be appreciated.
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.