user2255811
user2255811

Reputation: 496

Uncaught TypeError: Object [object Object] has no method 'datepicker'

this is the error i get when trying to use the datepicker widget: *has no method

<script type="text/javascript" language="javascript">
    $(function () {
        $("#from").datepicker({
            ....         
            }
        });
        $("#to").datepicker({
           ....
            }
        });
    });
</script>

This is the include file i'm using. The confusing part of this is that I use this same includes file on 3 pages and I only get the error on the one page. so it cant really be the script itself...I think

<!-- Datepicker widget -->
<script src="js/jquery-1.9.1.js" type="text/javascript"></script>
<script src="js/jquery-ui-1.10.1.custom.js" type="text/javascript"></script>
<script src="js/jquery-ui-1.10.1.custom.min.js" type="text/javascript"></script>
<link href="css/jquery-ui-1.10.1.custom.min.css" rel="stylesheet" type="text/css" />

any Ideas?

Upvotes: 5

Views: 8462

Answers (3)

Coxy
Coxy

Reputation: 1

I also had the same issue, it was caused by incorrectly using a mix of primefaces and richfaces - specifically when using p:calendar inside a4j:outputPanel.

Using p:outputPanel instead and removing the a4j namespace resolved the issue.

Upvotes: 0

user2146538
user2146538

Reputation: 344

Yes, the above solution worked for me too! Here is the complete code for anyone not completely sure... jQuery(function ($) { $("#datepicker").datepicker(); });

Upvotes: 0

user2255811
user2255811

Reputation: 496

Fixed there was a jQuery conflict on $ added a jQuery(function($){ which did the trick

Upvotes: 12

Related Questions