I am adding a new form to our website in Perl (wasn’t my choice). There is a lot of html generate automatically for the forms to create the consistant look. My problem comes in where the legacies use prototype for various things throughout the page (including on load). However i want to use jQuery and mainly the date picker from jQuery UI. I can avoid conflicts by using jQuery.noConflict();. But i still get an error becuase of a line of code in the jQuery date picker javascript.
inst.dpDiv.zIndex($(input).zIndex()+1);
See how it still contains the $ symbol, which prototype tries to handle but can’t. Does anyone have any solutions for me? I am using jQuery 1.5 and jQuery UI 1.8.6.
In summary: I can’t remove prototype.js, I would prefer to use jQuery UI datepicker and jQuery UI datepicker doesn’t handle jQuery.noConflict().
Thanks
EDIT
This only happens when i try to click on the button to show the date picker.
From firebug:
$(input).zIndex is not a function
inst.dpDiv.zIndex($(input).zIndex()+1);
datepicker.js (line 651)
EDIT EDIT
Updating to jQuery UI 1.8.9 doesn’t change the problem.
EDIT EDIT EDIT
This problem occurs when clicking the button to show the date picker. So on load the datepicker is set up fine. Changing the order of the scripts doesn’t work, and any sort of variation of the following code doesn’t work either.
(function($) {
$(function() {
// more code using $ as alias to jQuery
});
})(jQuery);
Thanks for all the responses. I couldn’t end up figuring out how to fix the conflict. So i removed the jQuery UI datepicker from the form. Thanks again.