Working with Materialize CSS library and Laravel to build a Survey application. Below is the HTML code I am using:
<div id="doDelete" class="modal bottom-sheet">
<div class="modal-content">
<div class="container">
<div class="row">
<h4>Are you sure?</h4>
<p>Do you want to remove this survey titled "{{ $survey->title }}"?</p>
<div class="modal-footer">
<a href="/survey/{{ $survey->id }}/delete" class=" modal-action waves-effect waves-light btn-flat red-text">Yes, delete it!</a>
<a class=" modal-action modal-close waves-effect waves-light green white-text btn">No, keep it!</a>
</div>
</div>
</div>
</div>
</div>
And here is the init.js code:
$(document).ready(function() {
$('.collapsible').collapsible({
accordion: false
});
$('.modal-trigger').leanModal();
$(document).on('click', '.delete-option', function() {
$(this).parent(".input-field").remove();
});
Encountering an error while trying to execute the delete function:
init.js:6 Uncaught TypeError: $(...).leanModal is not a function
at HTMLDocument.<anonymous> (init.js:6)
at j (jquery.min.js:2)
at Object.fireWith [as resolveWith] (jquery.min.js:2)
at Function.ready (jquery.min.js:2)
at HTMLDocument.I (jquery.min.js:2)
In addition, included init.js and jquery.min.js as well:
<script src="{{ URL::asset('jquery.min.js') }}"></script>
{!! MaterializeCSS::include_js() !!}
<script src="{{ URL::asset('init.js') }}"></script>
Appreciate any assistance provided. Thanks!