I have a lot of JQuery DatePicker's in my application. How can I set to all this elements default settings/options?
$(function() {
$( "#<%=dtIncident2.ClientID %>" ).datepicker({
showOn: "button",
buttonImage: "AppData/Images/calendar.gif",
buttonImageOnly: true,
showWeek: true,
firstDay: 1,
dateFormat: 'dd-mm-yy',
maxDate: '+0',
regional: 'uk'
});
});
I don't want to set every time showOn, buttonImage, buttonImageOnly... and other options.
did you even search for the answer before you asked? :P
http://docs.jquery.com/UI/Datepicker/setDefaults
$.datepicker.setDefaults({
showOn: 'both',
buttonImageOnly: true,
buttonImage: 'calendar.gif',
buttonText: 'Calendar' });
it's the first result when you google jquery ui datepicker set defaults.
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