Well this is a perfect use case for ajax request. When you open the model you can do an ajax request and fetch all the categories and all the connected categories and set them in the form you have.
Apr 22, 2018
3
Level 5
Dropdown List in Bootstrap Modal
I have a bootstrap modal form to create a post, I want to create a dropdown list for categories to which the post may belong to, but no clue how to get the list data back to and from the modal window. So far I have been using the "event.relatedTarget" to pass the data to input fields. But now how to pass the list?
$('#exampleModal').on('show.bs.modal', function (event) {
var button = $(event.relatedTarget)
var recipient = button.data('whatever')
var modal = $(this)
modal.find('.modal-title').text('New message to ' + recipient)
modal.find('.modal-body input').val(recipient)
})
Level 88
Yeah, solution 2 would be the best for this. This way your modal can operate on it's own ;)
Please or to participate in this conversation.