Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Button not working #35

Closed
PhilippeH1967 opened this issue Jun 9, 2019 · 5 comments
Closed

Button not working #35

PhilippeH1967 opened this issue Jun 9, 2019 · 5 comments

Comments

@PhilippeH1967
Copy link

I can see template with field date but the button on the right side with the calendar is not working...
Thanks for help

needed for using bootstrap_datepicker_plus

BOOTSTRAP3 = {
'include_jquery': True,
}
and add 'bootstrap_datepicker_plus', in installed apps

html file:

 {%  extends 'imports/base.html' %}
{%  load bootstrap3 %}
<!-- necessaire pour date picker -->
{% block extra_css %}
{{ form.media.css }}
{% endblock %}

{% block extra_js %}
{{ form.media.js }}
{% endblock %}
<!-- Fin date picker -->
{%  block title %}Imports Company{%  endblock %}
{%  block heading %}<h3 class="page-header-center">Creation Company</h3> {%  endblock %}
<hr>
<hr>
{% block page %}
   <form method="POST">
       {%  csrf_token %}
       <div class="col-lg-4 col-md-4 col-sm-4 content">
       {% bootstrap_form company_form %}
       <button type="submit" class="btn btn-pink pull-right">Create</button>
       </div>
   </form>
{% endblock %}

imports/base.html:

{%  load staticfiles %}
{% load bootstrap3 %} {# import bootstrap4/bootstrap3 #}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
<!-- Necessaire pour bootstrap datepicker -->
{% bootstrap_css %} {# Embed Bootstrap CSS #}
{% block extra_css %}
{{ form.media.css }}
{% endblock %}
<!-- fin du code boots trap datepicker -->
    <title>{% block title %}{% endblock %}</title>


    <link rel="stylesheet" href="{%  static 'css/bootstrap.min.css' %}">
    <link rel="stylesheet" href="{%  static 'css/style.css' %}">
    <script src="{%  static 'js/bootstrap.min.js' %}"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>

</head>
<body>

<div class="container-fluid">
    <div class="row">
        <div class="col-lg-2 col-md-2 col-sm-2 sidebar">
             {%  block sidebar %}{%  endblock %}
        </div>
        <div class="col-lg-10 col-lg-offset-2 col-md-10 col-md-offset-2 col-sm-10 col-sm-offset-2 content">
                {% block heading %}{% endblock %}
                {%  block page %}{% endblock %}
        </div>
    </div>

</div>


<!-- Necessaire pour bootstrap datepicker -->
{% bootstrap_javascript jquery='full' %} {# Embed Bootstrap JS+jQuery #}
{% block extra_js %}
{{ form.media.js }}
{% endblock %}
<!-- fin du code boots trap datepicker -->


</body>
</html>

and forms.py:

class CompanyForm(forms.ModelForm):
    class Meta:
        model = Company
        fields = ("company_name", "fiscal_end_of_year")
        widgets = {
            'fiscal_end_of_year': DatePickerInput(),  # default date-format %m/%d/%Y will be used
        }

models.py:

class Company(models.Model):
    company_id = models.IntegerField(default=170)
    company_name = models.CharField(max_length=100, null=False)
    fiscal_end_of_year = models.DateField()
@PhilippeH1967
Copy link
Author

Capture d’écran 2019-06-08 à 20 50 10

@PhilippeH1967
Copy link
Author

It seems that there is to jquery woring one 1.11 version and another 3.4.1 version. Is this normal ?

@pwalimbe
Copy link

pwalimbe commented Dec 3, 2019

I have the same issue. it works in Safari/Chrome but not in Firefox. Firefox shows the below error in console log.

None of the “sha384” hashes in the integrity attribute match the content of the subresource.

@somada141
Copy link

Hitting similar issues I followed the guide (https://monim67.github.io/django-bootstrap-datepicker-plus/configure/) and I'm now getting the picker to show up on Firefox but I'm getting the sha384 error above in the console. Did anyone figure this one out?

@monim67
Copy link
Owner

monim67 commented Nov 26, 2022

Closing pre v5 issues as stale. From v5 the error messages are more informative.

@monim67 monim67 closed this as not planned Won't fix, can't repro, duplicate, stale Nov 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants