This is my load clients function from where I pass value to clients.html page views.py
def load_clients(request):
CPA_id = request.GET.get('CPA_id')
clients = CPA_Client.objects.filter(CPA_id=CPA_id)
return render(request, 'crm/clients_dropdown_list_options.html', {"clients": clients})
# return JsonResponse(list(cities.values('id', 'name')), safe=False
client.html
<select id="ddselect" name="framework[]" multiple class="form-control">
<option value="----">------</option>
{% for Client_of_CPA in clients %}
<option value="{{ Client_of_CPA.pk }}">{{ Client_of_CPA.name }}</option>
{% endfor %}
</select>
In this code i am getting my output but need to select multiple values from a dropdown thats why i want to add some functionality of bootstrap jquery due to which i need script tag. After adding script tag page stop working
This is my whole code in html page
<!DOCTYPE html>
<html>
<head>
<script>
$(document).ready(function(){
$('#ddselect').multiselect(
{
nonSelectedText: 'Select Framework',
enableFiltering: true,
enableCaseInsensitiveFiltering: true,
closeOnSelect:false,
});
});
</script>
</head>
<body>
<select id="ddselect" name="framework[]" multiple class="form-control">
<option value="----">------</option>
{% for Client_of_CPA in clients %}
<option value="{{ Client_of_CPA.pk }}">{{ Client_of_CPA.name }}</option>
{% endfor %}
</select>
</body>
</html>