Giter Site home page Giter Site logo

Comments (9)

n3storm avatar n3storm commented on August 27, 2024

Do you already have loaded jquery library in your page?
Are you getting any 404 errores in network pane in your browser?

from django-bootstrap3-datetimepicker.

s7h avatar s7h commented on August 27, 2024

Yes, I have loaded jquery in my head before including {{form.media}}
and I'm not getting any 404s

from django-bootstrap3-datetimepicker.

tonjo avatar tonjo commented on August 27, 2024

Have you checked the generated html output?
Is id_serviceRequestDate_picker correct?
Given your field name, it should be id_serviceRequestDate.
From Django docs:

Its id, in turn, is generated by prepending 'id_' to the field name. 

from django-bootstrap3-datetimepicker.

 avatar commented on August 27, 2024

I'm having the same problem... It looks like adding the app to the installed apps doesn't add the javascript files... form.media doesn't either. Or there is a problem with having head in base.html and extending base.html.

from django-bootstrap3-datetimepicker.

tonjo avatar tonjo commented on August 27, 2024

Maybe I'm wrong, but simply check the real datepicker id.
I guess it's id_serviceRequestDate, not id_serviceRequestDate_picker.
Check it with Firebug or Chrome developer tools.

from django-bootstrap3-datetimepicker.

 avatar commented on August 27, 2024

I figured out the issue. If you change the name of the form you send to the template genorator, say my_form instead of form, you have to use {{my_form.media}}. If you have more then one form with a datepicker it is safe to call {{my_form.media}}{{my_other_form.media}}; resources will not be included twice.

OP must be passing the form under a different name, e.g. service_form, in the return render, which means he's not loading the resources and the datetimepicker function call can't be found thus generating the error he is getting.

from django-bootstrap3-datetimepicker.

 avatar commented on August 27, 2024

Developers you should make a note about this in the readme.

from django-bootstrap3-datetimepicker.

 avatar commented on August 27, 2024

Perhaps write in an example view where you retrieve and pass the form to the return render and highlight that the name of your form in the view must be the name you use in the {{form.media}} tag.

from django-bootstrap3-datetimepicker.

 avatar commented on August 27, 2024

Wait... Maybe I'm wrong about the problem. Either way that was my issues.

from django-bootstrap3-datetimepicker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.