{% extends "new_request.html" %}
{% load sekizai_tags %}

{% block extra_scripts %}
{{ block.super }}
{% addtoblock "endscripts" %}
<script>
  $(function () {
    var pages = {{ object.nb_pages }};
    var $copies = $('#div_id_reprography-copies');
    var $total = $('<span id="total_id_reprography-copies"></span>');
    $('input', $copies).after($total);
    function update_total() {
            var copies = parseInt($('input', $copies).val());
            $total.text(' X ' + pages + ' pages = ' + (copies*pages) + ' pages');
    }
    $('input', $copies).change(update_total);
    update_total();
  });
</script>
{% endaddtoblock %}
{% endblock %}
