0.0.47 add checkbox

This commit is contained in:
2023-07-27 13:56:15 +03:00
parent 1cf3041e95
commit e420dc17f2
11 changed files with 181 additions and 92 deletions

View File

@@ -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>