I'm having problems with jQueryUI Datepicker and Google Chrome. My datepicker works as expected with IE8, Firefox and Safari. The problem is clicking the date-related text box in Chrome. This gives me a crash page: "Unfortunately, an error occurred ...". My page has a text box with a dumper. Datepicker is language dependent and dynamically loads the correct language settings. Datpicker should also display drop-down lists of the month and year. 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 summarize datepicker with one parameter, i.e. changeYear, it works in Chrome. But if I add another parameter, i.e. changeMonth, Chrome will crash.
Is the code incorrect? If so, how to fix it?
Any help is much appreciated!
I updated the code to make it more readable. But still Chrome falls on me if I add the changeMonth parameter.
$(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 have any ideas on what could cause Chrome to crash?
source share