Issue
I'm developing prestashop module.now i'm trying to add datetime picker to my .tpl file
i tried below code.but it's date picker.
<div id="mymodule_block_home" class="block">
<input class="datetimepicker" type="text" >
<script type="text/javascript">
$(document).ready(function(){
$(".datetimepicker").datepicker({
prevText: '',
nextText: '',
dateFormat: 'yy-mm-dd'
});
});
</script>
</div>
I tried it with $(".datetimepicker").datetimepicker
.then my console showing Uncaught TypeError: $(...).datetimepicker is not a function
Solution
This happens when you haven't imported the jQueryUI into your current page.
TypeError: $(...).datepicker is not a function
You can reproduce the issue on this JSBin by deleting the jQueryUI script tag fram the head section: http://jsbin.com/feqarocebo/1/edit?html,console,output
First you have to check your page header. If there isn't listed the jQueryUI than you have to add it from the current controller
The accepted way is to do this:
public function setMedia() {
$this->addJqueryUI('ui.datepicker');
}
If this won't solve the issue then pls also check the project folder for the jQuery UI components/ .js files.
(or manually by editing the header.tpl).
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
Answered By - Gabo3D Answer Checked By - Robin (PHPFixing Admin)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.