I am trying to utilize Trent Richardson's Date Time Picker (see here).
I am trying to get the selected time when the popup closes, so I am using the following code (in an external .js file):
jQuery(function()
{
var startDateTextBox = jQuery('#start_date_field');
startDateTextBox.datetimepicker(
{
onClose: function(dateText, inst)
{
var testStartDate = startDateTextBox.datetimepicker('getDate');
alert(testStartDate);
}
});
});
However, the alert is coming up saying that the variable is undefined (which also happens when I step through the function). What am I doing wrong?
I opened up Trent's source and I noticed that he is using $ in place of jQuery - I saw elsewhere that you should always use jQuery in WordPress in order to put it into 'no conflict mode' - is that accurate? What are the ramifications of using $ instead of jQuery?
.noConflict()
does and is: Have you searched this site (or Stack Overflow or elsewhere) for the topic? See this answer, for instance. – Johannes Pille Apr 22 at 9:18