Reputation: 11
Hi i am studying web development and am new to this site, im having a problem showing the datepicker with JQuery and CodeIgniter.
Here is my code
VIEW
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Welcome to Kinsale property</title>
<link type="text/css" rel="stylesheet" href="<?php echo base_url('jquery-ui-1.12.0/jquery-ui.css'); ?>" />
</head>
<body>
<div id="container">
<h1>Welcome to Kinsale Property!</h1>
<script type="text/javascript">
$(function() {
$("#datepicker").datepicker({
minDate : 0,
dateFormat: 'yy-mm-dd'
});
});
</script>
<!--load jquery-->
<script src="<?php echo base_url('jquery-ui-1.12.0/jquery-1.10.2.js'); ?>"></script>
<!--load jquery ui js file-->
<script src="<?php echo base_url('jquery-ui-1.12.0/jquery-ui.js'); ?>"></script>
</body>
<p class="footer">Page rendered in <strong>{elapsed_time}</strong> seconds. <?php echo (ENVIRONMENT === 'development') ? 'CodeIgniter Version <strong>' . CI_VERSION . '</strong>' : '' ?></p>
</div>
</html>
Any help would be very much appreciated, Thank you.
Upvotes: 1
Views: 122
Reputation: 337
you are skip the tag where your jquery code are targeting i.e.
<input type="text" id="datepicker">
now html5 also provide datepicker just write this line
<input type="date" name="datepicker">
Upvotes: 2
Reputation: 894
put input field on you code you miss input type
<input type="text" id="datepicker">
Upvotes: 1