Autocomplete = "off" is ignored in IE?

I have a form with checkboxes, and their "verified" value is populated from the code in the database.

Imagine if I have checkboxes 1,2 and 3, all set for verification in the database. I load the page, uncheck box 3, and then commit the changes to the database. Now in my database, checkboxes 1 and 2 are checked, and 3 are not checked. I refresh the page, it gets the updated database values, and the checkboxes have the correct checked values.

This only works for me in chrome and FF. In IE, even if I uncheck 3, copy the changes to the database and update it, it will still be checked. I forcibly updated ctrl + f5 and it is still not updating. Adding autocomplete = "off" to the checkboxes and the parent form did nothing.

+6
source share
2 answers

This question has already been answered in the comments, but there is no corresponding answer in the answers. I am trying to answer it here so that it is useful for all other users who have encountered one problem.

The solution may be:

Serial ajax calls without changing the request are often considered cached by some browsers, and this problem is especially reproducible in IE 10 . The response to the HTTP 304 Not Modified request is and the request does not end up in the database. The solution is to use ajaxSetup to set cache to false as:

 $(document).ready(function() { $.ajaxSetup({ cache: false }); }); 

NOTE. This will set the cache to false for all ajax calls in the session.

OR

Using cache: false , in particular ajax calls, if you do not want to disable the cache for all ajax calls.

 $.ajax({ ... cache: false, ... }); 
+1
source

I think it is better to use javascript node.autocomplete = 'off' . Sometimes it helps.

And don't forget that IE sometimes really ignored autocomplete , for example, IE11 ignores autocomplete = off for the input type = "password" for keeps user in control .

0
source

Source: https://habr.com/ru/post/959423/


All Articles