Disable autocomplete all jquery datepicker input

I want to disable autocomplete for all inputs using jquery ui datepicker without doing this for each input manually. How can I do that?

+14
javascript jquery
source share
5 answers

try the following:

 $('.datepicker').on('click', function(e) { e.preventDefault(); $(this).attr("autocomplete", "off"); }); 

in any case, which you did not mention in your question, that this is an ajax call!

+23
source share

Try the following:

 <input type="text" name="field1" value="" autocomplete="off" /> 
+12
source share

Assign the css class to your feeds, i.e. "datepicker" and then follow these steps:

 $(".datepicker").attr("autocomplete", "off"); 
+11
source share

This works for me (it has been tested on Chrome v70.0.3538.110):

  $("#dtpckr([readonly])").datepicker() .focus(function() { $(this).prop("autocomplete", "off"); // return false; }); 
+1
source share

This works great for me.

  $("#autocmpldisablechk").click(function () { if (!$(this).is(":checked")) { // enable autocomplete $("#autocomplete").autocomplete({ disabled: false }); } else { // disable autocomplete $("#autocomplete").autocomplete({ disabled: true }); } }); 
+1
source share

All Articles