Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Aug 2012
    Location
    Mumbai, India
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    my Date and time picker JS is not working.

    Hi,

    I am developing a webpage using twitter bootstrap frame and calling a JS date and time Picker, but it is not working as I am not JS programmer I am not getting the error..

    here is the html code:

    <!DOCTYPE html>
    <html lang="en">

    <head>
    <title>B 2 B Responsive</title>
    <meta charset="utf-8">


    <link rel="icon" href="img/favicon.ico" type="image/x-icon">
    <link rel="shortcut icon" href="img/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="css/bootstrap.css" type="text/css" media="screen">
    <link rel="stylesheet" href="css/daterangepicker-bs3.css" type="text/css" media="screen" />

    <script type="text/javascript" src="js/moment.js"></script>
    <script type="text/javascript" src="js/daterangepicker.js"></script>
    <script type="text/javascript" src="js/jquery.min.js"></script>

    </head>

    <body>
    <div class="span9">
    <div class="well">
    <form class="form-horizontal">
    <fieldset>
    <div class="control-group">
    <label class="control-label" for="reservationtime">Reservation dates/label>
    <div class="controls">
    <div class="input-prepend">
    <span class="add-on"><i class="glyphicon glyphicon-calendar icon-calendar"></i></span>
    <input type="text" style="width: 300px" name="reservation" id="reservationtime" value="08/01/2013 1:00 PM - 08/01/2013 1:30 PM" class="span4"/>
    </div>
    </div>
    </div>
    </fieldset>
    </form>

    <script type="text/javascript">
    $(document).ready(function() {
    $('#reservationtime').daterangepicker({
    timePicker: true,
    timePickerIncrement: 30,
    format: 'MM/DD/YYYY h:mm A'
    });
    });
    </script>

    </div>
    </div>
    </body>
    </html>

    and uploaded link : http://jetflightz.com/responsive-tes...time-test.html

    I am taking this date and time picker from this page here it is working perfectly, but why it is not working on my above page...

    http://jetflightz.com/responsive-tes.../examples.html

    your early reply appreciated..

    Regards
    Shahzad

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,854
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Code:
    <script type="text/javascript" src="js/moment.js"></script>
          <script type="text/javascript" src="js/daterangepicker.js"></script>
     	  <script type="text/javascript" src="js/jquery.min.js"></script>
    If you inspect your page in the console tab of firebug, you'd see error like
    TypeError: $ is undefined


    $.fn.daterangepicker = function (options, cb) {

    datera...cker.js (line 854)
    TypeError: $(...).daterangepicker is not a function


    format: 'MM/DD/YYYY h:mm A'
    You need to add the jquery script tag before any other files using it.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •