1

how to use datatime picker in laravel 6 always i'm getting this error

Uncaught TypeError: $(...).datepicker is not a function
at HTMLDocument.<anonymous> (tasks:326)
at fire (jquery.js:1037)
at Object.fireWith [as resolveWith] (jquery.js:1148)
at Function.ready (jquery.js:433)
at HTMLDocument.completed (jquery.js:103)
1
  • Please give us help as soon, we stuck in... Commented Oct 29, 2020 at 4:22

1 Answer 1

0

Your error has not much to do with Laravel, it's a client-side problem, you are trying to call datepicker() function of a jQuery object, but that function does not exist. You will need to ensure that at the point of the function call, the element exists as well as it complies to all criterias asked for by jQuery's datepicker. If you need further help, then provide us your structure and the relevant JS code, not just the stack trace.

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

7 Comments

this is my app.blade.php @Lajos Arpad <script src="{{ asset('js/app.js') }}" defer></script><script src="{{ asset('js/menu.js') }}" defer></script> <!-- jQuery CDN - Slim version (=without AJAX) --> <script src="ajax.googleapis.com/ajax/libs/jquery/1.9.1/…> <script src="cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.5.0/js/…>
this is my blade <input type="text" id="datepicker"> section('scripts') <script> $( document ).ready(function() { $( "#datepicker" ).datepicker(); }); </script> endsection
@Ashan is it possible that you have included jquery multiple times? That's a known possible cause of this issue.
how can i fix it?
If jquery is included several times into your page, then the solution is to remove all its duplicates. Since you use cloudflare and it caches your stuff, you will need to empty the cache when you test
|

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.