Set input mode numeric on fields

This commit is contained in:
Gabriel Augendre 2023-03-27 17:46:28 +02:00
parent 9b381a0e18
commit 755d896f1c
2 changed files with 3 additions and 2 deletions

View file

@ -15,7 +15,7 @@
<h4 class="card-title">{{ product.name }}</h4>
<div class="input-group">
<button class="btn btn-danger" type="button" onclick="decrementValue('{{ field.id_for_label }}')"><i class="fa-solid fa-minus"></i></button>
{% crispy_field field 'class' 'form-control' %}
{% crispy_field field 'class' 'form-control' 'inputmode' 'numeric' %}
<button class="btn btn-success {% if field.value %}border-white{% endif %}" type="button" onclick="incrementValue('{{ field.id_for_label }}')"><i class="fa-solid fa-plus"></i></button>
</div>
</div>

View file

@ -14,7 +14,8 @@
<div class="card-body">
<h4 class="card-title">{{ product.name }}</h4>
<div class="input-group">
<input type="number" step="1" name="unpriced_product-{{ product.pk }}" min="0" class="numberinput form-control" required="" id="unpriced_id_product-{{ product.pk }}"
<input type="number" step="1" inputmode="numeric" min="0"
name="unpriced_product-{{ product.pk }}" class="numberinput form-control" required="" id="unpriced_id_product-{{ product.pk }}"
value="{{ value|default:0 }}"
>
<span class="input-group-text" id="basic-addon1">cts</span>