Possible bug with text and just before a submit or change set it to the selected value. Is there another suggestion? I guess I was wondering if this is a bug or I'm doing something wrong. – user603749 Apr 29 '13 at 14:56

  • I stumbled across the same problem, and after hours of headbanging against my own code, I came to the same conclusions. The autocomplete=off instantly fixed it. – Cyprus106 Feb 10 '15 at 04:24
  • This just hit me now. 6 years after. Do we know the root of it? – SpaceBeers Jun 21 '19 at 10:21
  • No. Just use one of the suggested workarounds and move on :) – user603749 Jun 23 '19 at 23:38
  • 3 Answers3

    24

    I was having the same issue, and came across this issue while searching Google. For anyone else stumbling across this: I fixed the issue by setting 'autocomplete="off"' on the form. Of course, this may not be desirable for all situations.

    I'm running Chrome 30.0.1599.101 on OSX 10.9. The web site is built using the Wicket framework (which uses jQuery for AJAX).

    Chris Snyder
    • 437
    • 3
    • 14
    • 8
      How did you find it? It's a pure black magic. We should be officially designated as sorcerers. – mp31415 Mar 21 '14 at 21:35
    • 4
      Genius. I'd already spent hours... but you saved me hours MORE. THANK YOU. – Cyprus106 Feb 10 '15 at 04:23
    • 1
      Am still getting this issue on Chrome 47 with Wicket. Wrapped my select in a form and added autocomplete=off and it worked like a charm. – Aaron Dec 30 '15 at 14:47
    • 2
      Oh, my word. I was starting to think it was impossible and was prepared to re-do the entire page (writing asp.net `DropDownLists` to the page from the code behind) and use an `UpdatePanel`. This issue was a huge deciding factor. I set `AutoComplete="Off"` and it worked. Yeah, that saved me a ton of hours of work. – Hawkeye Nov 14 '17 at 22:52
    • 1
      @chris-snyder - how did you find the solution? – SpaceBeers Jun 21 '19 at 10:22
    • 1
      @SpaceBeers— It's been a while, so I don't remember the specifics. But I'm sure it was my usual combination of domain knowledge (at least an awareness that the 'autocomplete' attribute is a thing), web searches, experimentation, and dumb luck. – Chris Snyder Jun 21 '19 at 14:36
    0

    I found an simple workaround by creating a hidden text and just before a submit or change set it to the selected value.

    user603749
    • 1,638
    • 2
    • 24
    • 36
    0

    Simple jQuery workaround.

    $(document).ready(function () {
        $("select").each(function () {
            $(this).val($(this).find('option[selected]').val());
        });
    })
    
    batMask
    • 734
    • 3
    • 17
    • 35