Why doesn't Firefox show the correct default select option?

前端 未结 11 1059
醉酒成梦
醉酒成梦 2020-11-28 07:02

I\'m making a web app to manage product SKUS. One part of that is to associate SKUs with product names. On each row of a table, I list a SKU and display a

相关标签:
11条回答
  • 2020-11-28 07:50

    I had a similar problem, but after adding autocomplete="off" HTML attribute to every select tag it worked. [I was using Firefox 8]

    0 讨论(0)
  • 2020-11-28 07:50

    An easy way to prevent Firefox from caching the last selected option is to remove all of the option elements on page unload. For example (assuming jQuery):

    $(window).unload(function() {
      $('select option').remove();
    });
    
    0 讨论(0)
  • 2020-11-28 07:50

    Firebug has a cache disable function for exactly this scenario.

    The deeper long-term solution is to work out how set no-cache headers server side. What web server are you using?

    0 讨论(0)
  • 2020-11-28 07:54

    Firefox preserves your selected form elements when you refresh. It's intentional. Ctrl+F5 is a "hard" refresh, which disables this behavior.

    --

    Or Command+Shift+R if you are on a Mac

    0 讨论(0)
  • 2020-11-28 08:04

    I make it worked by putting the autocomplete="off" on the hidden input.

    0 讨论(0)
提交回复
热议问题