Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
10
rated 0 times [  17] [ 7]  / answers: 1 / hits: 20158  / 11 Years ago, tue, october 22, 2013, 12:00:00

I am using Yii Framework to develop an application. I am using


$(document).ready(function(){

$('.date-picker').datepicker();

});

everywhere it is running, but when I am placing it in index.php view file, then it is giving me the following error in firefox console:



TypeError: $(...).datepicker is not a function


$('.date-picker').datepicker();



I have search the above error everywhere but no solutions are applicable in my criteria from stackoverflow, and other blogs for this query.


Thanks


More From » jquery

 Answers
23

Try to include jquery library files in your view page. I had the same problem two weeks ago,but when i called it separetely my problem got solved.



<?php
Yii::app()->clientScript->registerCoreScript('jquery');
Yii::app()->clientScript->registerCoreScript('jquery.ui');

Yii::app()->clientScript->registerScriptFile(Yii::app()->baseUrl .'/js/jquery.ui.datepicker.js'); ?>

[#74817] Monday, October 21, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
soniap

Total Points: 626
Total Questions: 119
Total Answers: 110

Location: Palestine
Member since Tue, Jul 20, 2021
3 Years ago
soniap questions
Mon, Jun 22, 20, 00:00, 4 Years ago
Fri, May 8, 20, 00:00, 4 Years ago
Fri, Mar 20, 20, 00:00, 4 Years ago
;