<h2>Ajouter un lieu favori</h2>
<div class="new-place">
  {% include "combo/json/includes/new-place-form.html" with button_label="Étape suivante" prefill=True %}
</div>

<script>
$(function() {
  $('form button').attr('formnovalidate', 'formnovalidate');
  $('form').on('submit', function(ev) {
    var next_url = $('.linkcell a').attr('href');
    if ($('input[name=nom]').val() &&
        $('input[name=adresse]').val() &&
        $('input[name=codepostal]').val() &&
        $('input[name=ville]').val()) {
      var action_url = $('form').attr('action');
      $.post(action_url, $('form').serialize(),
        function() {
          window.location = next_url;
        }
      );
      return false;
    }
    window.location = next_url;
    return false;
  });
});
</script>
