JQuery Code executed BUT appears as text on the webpage as well
Hi,
I just started out with JQuery and ran into some difficulties which I could not solve by myself. I used the bootbox plugin to create a dialog box if there is any error in the form input. The code works in the sense that the dialog box appears but at the same time the code snippet bootbox.alert("Hello world!"); is shown. I tried many things, amongst others the obvious of putting <script> tags around the code but code does not get executed.
- <form class='form-horizontal' method="POST" action=""> {% csrf_token %}
- <div class='form-group form-group-lg'>
- {% if form.email.errors %}
- {% block jquery %}
- {% for err in form.email.errors %}
- bootbox.alert("Hello world!");
- {% endfor %}
- {% endblock %}
- {% endif %}
- </div>
- </form>
Does anyone has has experience with similar issues and can give me a hint?