Remove required

This commit is contained in:
Mickael Veaudour 2024-08-06 08:45:16 +02:00
parent 753badab38
commit 1650cb7878
No known key found for this signature in database
2 changed files with 3 additions and 7 deletions

View file

@ -3,10 +3,6 @@ function filterClasse() {
$("#eleves div.form-group").filter(function() { $("#eleves div.form-group").filter(function() {
var text = $(this).attr('classe').toLowerCase(); var text = $(this).attr('classe').toLowerCase();
$(this).toggle(text.indexOf(value) > -1); $(this).toggle(text.indexOf(value) > -1);
if (text.indexOf(value) > -1)
$(this).find('.form-control').removeAttr('required');
else
$(this).find('.form-control').addAttr('required');
}); });
} }

View file

@ -40,7 +40,7 @@
<div class="form-group" classe="{{ eleve.getClasse() }}"> <div class="form-group" classe="{{ eleve.getClasse() }}">
<label class="control-label col-sm-2" for="eleve_{{ eleve.getId() }}">{{ eleve.getNom() }}</label> <label class="control-label col-sm-2" for="eleve_{{ eleve.getId() }}">{{ eleve.getNom() }}</label>
<div class="col-sm-10"> <div class="col-sm-10">
<input type="number" class="form-control" id="eleve_{{ eleve.getId() }}" name="eleve_{{ eleve.getId() }}" min="0" max="20" step="0.1" required> <input type="number" class="form-control" id="eleve_{{ eleve.getId() }}" name="eleve_{{ eleve.getId() }}" min="0" max="20" step="0.1">
</div> </div>
</div> </div>
{% endfor %} {% endfor %}