3👍
✅
Change your <a>
tag to the following:
<a class="btn btn-info btn-block btn-password" href="#"
data-toggle="modal" data-target="#change-password">Alterar senha</a>
At least this is how I do it in my Django templates. As I think @souldeux was trying to say, you need to use the data-target
attribute to specify the modal itself, rather than the href
; I usually just use #
for that in cases like this.
Also, make sure that you are not only loading the bootstrap css code, but also the bootstrap js libraries. In other words, make sure you have the following (or some equivalent) in your template:
<!-- Latest compiled and minified JavaScript (at the time of this post) -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
In addition to your css:
<!-- Latest compiled and minified CSS (at the time of this post) -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
Which I assume you already have, because otherwise things would look weird.
0👍
<a class="btn btn-info btn-block btn-password" href="#change-password" data-toggle="modal">Alterar senha</a>
You need a data-target
attribute in addition to your data-toggle
. http://getbootstrap.com/javascript/#live-demo
- [Django]-Django runserver error while loading shared libraries: libssl.so.0.9.8: cannot open shared object file: No such file or directory
- [Django]-Is django thread blocked while sending email?
- [Django]-The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute
- [Django]-Implementing Django language selection form as buttons
- [Django]-Connect to a PostgreSQL database on a Docker container
0👍
try changing the tag “a” to tag “button” in
<a class="btn btn-info btn-block btn-password" href="#change-password"
data-toggle="modal">Alterar senha</a>
and hide to fade in
<div class="modal hide" id="change-password">
- [Django]-Django validate field based on value from another field
- [Django]-Versioning a TastyPie Api with the Accept header
- [Django]-Using login() loses the session data
- [Django]-Django collectstatic on S3 uploads unchanged files everytime on Heroku
- [Django]-How to set authentication and permission only on PUT requests in django REST in viewsets?
Source:stackexchange.com