I am using the jQuery datepicker in a new application. I am initializing the jQuery and jQuery UI as follows.
<script type="text/javascript">
//=== Load in any web modules necessary
google.load("jquery", "1");
google.load("jqueryui", "1");
</script>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.9.0/themes/base/jquery-ui.css" />
The input is:
<input id="cqupmj" class="hasDatepicker" type="text" value="12-18-2012">
My datepicker jQuery control function is defined as follows:
var dte = $('#cqupmj').val();
Date (dte) input in the format: ’12-18-2012′
$( "#cqupmj" ).datepicker({
defaultDate: dte,
dateFormat: 'mm-dd-yyyy',
//dateFormat: 'yyyy-mm-dd',
changeMonth: true,
changeYear: true,
numberOfMonths: 1,
//dateFormat: 'mm-dd-yy',
altFormat: 'mm-dd-yyyy',
onSelect: quote.get_date
});
The XML error is as follows:
Error: An exception occurred.
Traceback (most recent call last):
File "resource://jid1-f9uj2thwoam5gq-at-jetpack/api-utils/lib/system/events.js", line 58, in
data: data
File "resource://jid1-f9uj2thwoam5gq-at-jetpack/api-utils/lib/observer-service.js", line 35, in listener
callback.call(target || callback, subject, data);
File "resource://jid1-f9uj2thwoam5gq-at-jetpack/collusion/lib/main.js", line 395, in
queueInfo(connection);
File "resource://jid1-f9uj2thwoam5gq-at-jetpack/collusion/lib/main.js", line 197, in queueInfo
if (types.indexOf(info.type) == -1) {
TypeError: types is undefined
These datepickers worked at one time and now do not. The code did not change, but I cannot figure out what is wrong. How do I fix it?
Remove the
hasDatepickerclass from your code,The default date is also not needed if you take it from same input. See demo.
The date format should be also
mm-dd-yy, notmm-dd-yyyy.Also be sure to wrap your init functions with
$(function() {/*INIT CODE*/}.The errors you are getting seems to come from your browser extensions errors, not your page.