I'm having some problems with jQueryUI Datepicker and Google Chrome. My datepicker is working as expected with IE8, Firefox and Safari. The problem is when clicking the datepicker connected textbox in Chrome. It gives me a crash page, "Oops, an error occurred...". On my page there's textbox with a datepicker. The datepicker is language dependent and it loads the correct language settings dynamically. The datepicker should also display the month and year dropdowns. The code is as follows
$(function() {
$.datepicker.setDefaults($.extend({ changeMonth: true, changeYear: true }, $.datepicker.regional['']));
$('#<%= TextBoxBirthDate.ClientID %>').datepicker($.datepicker.regional[$('#LabelRegionalSettings').val()]);});
If I only extend the datepicker with one option, i.e. changeYear, it works in Chrome. But if I add another option, i.e. changeMonth, the 'crash' in Chrome occurs.
Is my code incorrect? If so, how do I fix it?
Any help is greatly appreciated!
I've updated the code to make it more readable. But still Chrome crashes on me if I add the changeMonth option.
$(function() {
$.datepicker.setDefaults($.datepicker.regional['']);
$('#<%= TextBoxBirthDate.ClientID %>').datepicker($.datepicker.regional[$('#LabelRegionalSettings').val()]);<br />
$('#<%= TextBoxBirthDate.ClientID %>').datepicker('option', 'changeMonth', true);
$('#<%= TextBoxBirthDate.ClientID %>').datepicker('option', 'changeYear', true);
$('#<%= TextBoxBirthDate.ClientID %>').datepicker('option', 'yearRange', '-50:+0');
});
Anyone got any ideas of what might cause Chrome to crash?