Topic: Select doesn’t work in MDB3
michaelenglo pro asked 7 years ago
michaelenglo pro answered 7 years ago
Bartłomiej Malanowski staff pro premium answered 7 years ago
michaelenglo pro answered 7 years ago
Rafał Rogulski answered 7 years ago
</body>
, after all, html code.
In your code material select is trying to be initialized but any of them can be found because not all HTML file is a load.
Regards
michaelenglo pro answered 7 years ago
Rafał Rogulski answered 7 years ago
</body>
i meant, to place all your scripts before body closing tag and after content, something like this:
<!DOCTYPE html>
<html lang="en">
<head>
[link, meta and other stuff]
</head>
<body>
[some content]
<div class="col-sm-6">
<div class="form-group">
<label for="fActive">Status</label>
<select class="fActive" name="fActive">
<option value="1" selected>Active</option>
<option value="0">Suspended</option>
<option value="1">Active</option>
<option value="0" selected>Suspended</option>
</select>
</div>
</div>
[more content]
<!-- SCRIPTS -->
<!-- JQuery -->
<script type="text/javascript" src="js/jquery.min.js"></script>
<!-- Bootstrap core JavaScript -->
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<!-- Material Design Bootstrap -->
<script type="text/javascript" src="js/mdb.min.js"></script>
<script>
// Material Select Initialization
$(document).ready(function () {
$('select').material_select();
});
</script>
</body>
</html>
Check if material select will work without you template engine markdown:
{% if customer.b_active %}
{% else %}
{% endif %}
Regards michaelenglo pro answered 7 years ago
Rafał Rogulski answered 7 years ago
michaelenglo pro answered 7 years ago
Rafał Rogulski answered 7 years ago
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
- User: Pro
- Premium support: No
- Technology: General Bootstrap questions
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No