Folks,
I have a problem with jquery choosen plugin.
I have 2 lists of items, list_of_all_items
(it's list of all items in all cases) and list_of_items_in_case
(it's list of items in specify case). Items from list list_of_items_in_case
are also included in list list_of_all_items
And I need to make 3 things in one form:
- Select all items from
list_of_items_in_case
automatically (all items from this list should be selected), - Posibiliteis to select every single item from list
list_of_all_items
, - Posibilities to add new item by de customer.
I found this plugin here https://harvesthq.github.io/chosen/
. And I created only this:
{% block head %}
<script type="text/javascript" src="{% static '/plugins/chosen/chosen.jquery.min.js' %}"></script>
<link rel="stylesheet" href="{% static '/plugins/chosen/chosen.css' %}">
<style>
items p{
font-size: 1em;
font-weight: bold;
padding: 1em;
margin: 0;
display: table;
</style>
<script type="text/javascript">
function onTagChange()
{
$( "#form_tags" ).submit();
}
$(document).ready(function () {
$(".chosen-select").chosen();
});
</script>
{% endblock %}
{% block nav %}{% endblock %}
{% block content %}
<form id="items" method="post">
{% for item in list_of_items_in_case %}
<div class="box items">
<div class="items">
<p><font color="greenyellow"><b>Items: </b></font>{{ list_of_items_in_case }}</p>
<select id="items" name="item" multiple class="chosen-select" tabindex="2" for="items">
{% for item in list_of_items_in_case %}
<option value="{{item}}">{{item}}</option>
{% endfor %}
</select>
</div>
<hr /><br>
<hl></hl>
{% endfor %}
</form>
And only thing which it's able to make is preprare a form where I can select items from list_of_items_in_case and I've no idea how to do the rest properly.
Maybe I expect too much from this plugin and should I find another?
BR, Damian