0.0.47 add checkbox
This commit is contained in:
@@ -148,25 +148,40 @@
|
||||
<div>
|
||||
<label for="id_cargo_type">{{ form.fields.cargo_type.label }}</label>
|
||||
</div>
|
||||
<div>
|
||||
<select
|
||||
multiple
|
||||
size="5"
|
||||
name="cargo_type"
|
||||
id="id_cargo_type"
|
||||
{% if form.fields.cargo_type.required %} required{% endif %}>
|
||||
{% for item in form.fields.cargo_type.choices %}
|
||||
<option
|
||||
value="{{ item.0 }}"{% if form.fields.cargo_type == item.0 %}
|
||||
selected="selected"{% endif %}>{{ item.1 }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
{#<div>#}
|
||||
{# <select#}
|
||||
{# multiple#}
|
||||
{# size="5"#}
|
||||
{# name="cargo_type"#}
|
||||
{# id="id_cargo_type"#}
|
||||
{# {% if form.fields.cargo_type.required %} required{% endif %}>#}
|
||||
{# {% for item in form.fields.cargo_type.choices %}#}
|
||||
{# <option#}
|
||||
{# value="{{ item.0 }}"{% if form.fields.cargo_type == item.0 %}#}
|
||||
{# selected="selected"{% endif %}>{{ item.1 }}#}
|
||||
{# </option>#}
|
||||
{# {% endfor %}#}
|
||||
{##}
|
||||
{# </select>#}
|
||||
|
||||
</select>
|
||||
{% if form.errors and form.errors.cargo_type %}
|
||||
{# </div>#}
|
||||
|
||||
<div>
|
||||
{% for item in form.fields.cargo_type.choices %}
|
||||
<input
|
||||
type="checkbox"
|
||||
name="cargo_type"
|
||||
id="id_cargo_type"
|
||||
{% if form.fields.cargo_type.required %} required{% endif %}
|
||||
value="{{ item.0 }}"
|
||||
{% if form.fields.cargo_type == item.0 %}
|
||||
{% endif %}/>{{ item.1 }}
|
||||
{% endfor %}
|
||||
{% if form.errors and form.errors.cargo_type %}
|
||||
<span>{{ form.errors.cargo_type }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<hr>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user