Home > Web Front-end > JS Tutorial > jQuery UI Datepicker length is empty or not an object error solution_jquery

jQuery UI Datepicker length is empty or not an object error solution_jquery

WBOY
Release: 2016-05-16 18:13:47
Original
1130 people have browsed it

When we develop an ASP.NET site, if we use jQuery UI Datepicker in combination with ASP.NET validation controls (such as RequiredFieldValidator):

Copy code The code is as follows:





Then when we select a date in Datepicker, "'length' is empty" will appear or is not an object" error. This is caused by a bug in Datepicker. After my research, I found a very simple solution - capture the onSelect event of Datepicker but do not do any processing:
Copy the code The code is as follows:

$("#<%= txtDate.ClientID %>").datepicker({
onSelect: function( dateText, inst) {
//No processing
}
});

Now when we select a date, "'length' is empty" will not appear or is not an object" error, and the ASP.NET validation control can run as usual.
Related labels:
ui
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template