Project

General

Profile

« Previous | Next » 

Revision 13bda29b

Added by Benjamin Dauvergne over 11 years ago

use new .enable-on-change class in template simple-form.html

View differences:

calebasse/templates/calebasse/simple-form.html
12 12
        {{ form.as_p }}
13 13
      </div>
14 14
      {% block buttons %}
15
      <button>Modifier</button>
15
      <button class="enable-on-change">Modifier</button>
16 16
      {% endblock %}
17 17
      <a href="..">{% block back-link %}Retour{% endblock %}</a>
18 18
    </form>
19 19
{% endblock %}
20

  
21
{% block page-end %}
22
<script>
23
  $('form button').prop('disabled', 'true');
24
  $(function () {
25
    $('form input, form select').on('change', function () {
26
      $('form button').enable();
27
    })
28
  });
29
</script>
30
{% endblock %}
31

  
32

  

Also available in: Unified diff