I want to disable autocomplete
for all inputs using jquery ui datepicker without doing this to every input manually. How could be this done?
datepicker'). on('click', function(e) { e. preventDefault(); $(this). attr("autocomplete", "off"); });
To disable a datepicker in jQuery UI we will be using disable() method which is discussed below: jQuery UI disable() method is used to disable the datepicker. Parameters: This method does not accept any parameters.
The JavaScript DatePicker (Calendar Picker) is a lightweight and mobile-friendly control that allows end users to enter or select a date value. It has month, year, and decade view options to quickly navigate to the desired date.
try this:
$('.datepicker').on('click', function(e) { e.preventDefault(); $(this).attr("autocomplete", "off"); });
in anycase you have not mentioned in your question that this is coming from an ajax call!
Try this:
<input type="text" name="field1" value="" autocomplete="off" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With