0

I'm having some trouble trying to use the bootstrap date-picker (http://tinyurl.com/o7njj9n).

I tried using suggestions from these 2 threads: laravel using twitter bootstrap and datepicker and Laravel 4 with bootstrap-datepicker but not luck in solving the problem.

Currently, this is what I have for my form field:

{{ Form::text('date', null, array('type' => 'text', 'class' => 'form-control datepicker','placeholder' => 'Pick the date this task should be completed', 'id' => 'calendar')) }}

I reference the CSS and JS in my master template, as such:

<link rel="stylesheet" href="css/datepicker3.css">

<script type="text/javascript" src="/bootstrap-datepicker.js"></script>

I have the following javascript:

<script type="text/javascript">
$(document).ready(function() {

    $('#calendar').datepicker({
    });

} );
</script>

I'm not sure what's wrong?

Thanks for any help.

EDIT: The problem is that the calendar does not appear upon clicking inside the text field.

5
  • Can you also describe what the problem is or which errors you see if any? Commented Sep 10, 2014 at 19:07
  • Are there any errors in your developer tools console? Commented Sep 10, 2014 at 19:13
  • I see no errors. The calendar just doesn't show when I click on the text field. Commented Sep 10, 2014 at 19:24
  • remove 'data-datepicker' => 'datepicker' from your input field. Commented Sep 10, 2014 at 21:35
  • Hi Edward, I've done as you suggest, but no luck. I've edited the code in my question to reflect this. Commented Sep 10, 2014 at 22:52

1 Answer 1

0

The problem was solved by moving the 'date-picker.js' script dependency below the jquery dependency. A bit silly, I guess, but I'm new to web-dev :/

Sign up to request clarification or add additional context in comments.

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.