mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-22 11:23:10 +00:00
Ajout du champ requiered si le disclaimer est affiché
This commit is contained in:
parent
ff57709337
commit
dc5ba19e59
1 changed files with 27 additions and 8 deletions
|
@ -37,7 +37,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.1/themes/smoothness/jquery-ui.css" type="text/css">
|
||||
|
||||
<script type='text/javascript'>
|
||||
|
||||
function submitBday() {
|
||||
var field = document.getElementById("file");
|
||||
var Bdate = document.getElementById('bday').value;
|
||||
|
@ -66,26 +65,26 @@ function submitBday() {
|
|||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
{{ userform.surname.label_tag }}
|
||||
{% render_field userform.surname class="form-control" %}
|
||||
{% render_field userform.surname class="form-control" requiered=True %}
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
{{ userform.pseudo.label_tag }}
|
||||
{% render_field userform.pseudo class="form-control" %}
|
||||
{% render_field userform.pseudo class="form-control" requiered=True %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
{{ userform.email.label_tag }}
|
||||
{% render_field userform.email class="form-control" %}
|
||||
{% render_field userform.email class="form-control" requiered=True %}
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
{{ userform.telephone.label_tag }}
|
||||
{% render_field userform.telephone class="form-control" %}
|
||||
{% render_field userform.telephone class="form-control" requiered=True %}
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label>Date de naissance</label>
|
||||
<input class="form-control" id="bday" name="bday" date-date-format="dd-mm-yy" placeholder="Date de naissance" type="date" onchange="submitBday()">
|
||||
<input class="form-control" id="bday" name="bday" date-date-format="dd-mm-yy" requiered=True placeholder="Date de naissance" type="date" onchange="submitBday()">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -95,14 +94,34 @@ function submitBday() {
|
|||
{% render_field userform.disclaimer class="form-control" %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type='text/javascript'>
|
||||
function submitBday() {
|
||||
var field = document.getElementById("file");
|
||||
var Bdate = document.getElementById('bday').value;
|
||||
var Bday = +new Date(Bdate);
|
||||
var age = ((Date.now() - Bday) / (31557600000));
|
||||
|
||||
if (age < 18){
|
||||
field.style.display = "block";
|
||||
document.getElementById("{{userform.disclaimer.auto_id}}").required = true;
|
||||
}
|
||||
else{
|
||||
field.style.display = "none";
|
||||
document.getElementById("{{userform.disclaimer.auto_id}}").required = false;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="form-group">
|
||||
{{ userform.school.label_tag }}
|
||||
{% render_field userform.school class="form-control" %}
|
||||
{% render_field userform.school class="form-control" requiered=True %}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ userform.room.label_tag }}
|
||||
{% render_field userform.room class="form-control" %}
|
||||
{% render_field userform.room class="form-control" requiered=True %}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ userform.comment.label_tag }}
|
||||
|
|
Loading…
Reference in a new issue