
<div class="modal-body">
    <form method="post" name="form_commentaire" id="form_commentaire" class="box-form">
        <div class="row">
            <label for="commentaire">{{ 'Commentaire' | trad }}</label>
            <textarea class="form-control" name="commentaire" id="commentaire">
                {{- note.CONTMEMO -}}
            </textarea>
        </div>
        <div class="modal-footer">
            <button type="button" class="button secondaire" data-dismiss="modal" onclick="desactivePopup ();">{{ 'Annuler' |trad }}</button>
            <button type="button" class="button principal"  onclick="sendForm('form_commentaire');">{{ 'Enregistrer' | trad }}</button>
        </div>
    </form>
</div>

<script>
    function sendForm(nomForm) {
	    $.ajax({
			dataType : 'html',
            url: '{{ path('Commande.ajaxGestionCommande.annulerCommande', {idCommande:idCommande}) }}',
            data:$('#'+ nomForm).serialize(),
            type: "POST",
            statusCode: {
                413: function(xhr) {
                    desactiveLoader();
                    desactivePopup();
                    alert('Error - ModSecurity.');
                }
            },
            success: function(result){
                desactivePopup();
                refrechDiv(window.location.pathname, 'commandes', 'filtre_commande');
                location.reload();
            }
        });
    }
</script>