1

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.

1
  • and where is your input? Commented Oct 13, 2016 at 9:50

2 Answers 2

2

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">
Sign up to request clarification or add additional context in comments.

Comments

1

put input field on you code you miss input type

<input type="text" id="datepicker">

Comments

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.