5

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?

7
  • 1
    Include the datepicker file above this code. Commented Apr 28, 2013 at 23:56
  • I have this is what it looks like <!-- 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" /> Commented Apr 28, 2013 at 23:57
  • Which one is the datepicker file? Commented Apr 29, 2013 at 0:00
  • 3
    You included custom.js twice. (min.js is the same as .js) Commented Apr 29, 2013 at 0:05
  • Is it that page in the same directory as other working pages? Commented Apr 29, 2013 at 0:33

3 Answers 3

12

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

Sign up to request clarification or add additional context in comments.

Comments

0

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

Comments

0

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.

1 Comment

Welcome to stackoverflow! Take this tour to get to know how this site works and what it is for. Consider formatting your answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.