Start with previous value or default values (1+0)

This commit is contained in:
Remi Rampin 2022-05-22 01:04:09 -04:00
parent f980973f6e
commit 33d9f2ef3d
1 changed files with 20 additions and 2 deletions

View File

@ -10,11 +10,29 @@
<form action="" method="POST">
<p>
<label for="adults">Adultes :</label>
<input type="number" name="adults" id="adults" min="1" max="5" />
<input
type="number"
name="adults" id="adults"
min="1" max="5"
{% if adults is not none %}
value="{{ adults }}"
{% else %}
value="1"
{% endif %}
/>
</p>
<p>
<label for="children">Enfants :</label>
<input type="number" name="children" id="children" min="0" max="5" />
<input
type="number"
name="children" id="children"
min="0" max="5"
{% if children is not none %}
value="{{ children }}"
{% else %}
value="0"
{% endif %}
/>
</p>
<p><input type="submit" value="RSVP" /></p>
</form>