Firefox keeps form data on reload

后端 未结 8 2106
忘掉有多难
忘掉有多难 2020-12-02 14:59

I have a big problem with the functionality in Firefox that keeps data that the user have filled in on reload F5. If i use Ctrl+F5 the forms

8条回答
  •  南方客
    南方客 (楼主)
    2020-12-02 15:58

    I tried the shortened solution above, but it didn't clear the value of the select boxes on my page.

    I ended up modifying it slightly and now all input types on the page are cleared regardless of type:

    var allInputs = $(":input");
    $(allInputs).attr('autocomplete', 'off');
    

    So to make this run onload I just put it in the ready() method:

    $(document).ready(function () {
        var allInputs = $(":input");
        $(allInputs).attr('autocomplete', 'off');
    });
    

提交回复
热议问题