<form
  hx-post="{{ url("subscription:fragment-existing-user") }}"
  hx-target="this"
  hx-disable="find input[type='submit']"
  hx-swap="outerHTML"
>
  {% csrf_token %}

  <div x-data="existing_user_subscription_form" class="form-content existing-user">
    <fieldset>
      {{ form.non_field_errors() }}
      <div class="form-group">
        {{ form.member.label_tag() }}
        {{ form.member|add_attr("x-ref=userSelect,x-model=selectedUser") }}
      </div>
      <div class="form-group">
        {{ form.birthdate.label_tag() }}
        {{ form.birthdate|add_attr(":value=dateOfBirth,:hidden=dateOfBirthHidden,:type=dateOfBirthHidden ? 'hidden' : 'date'") }}
        <span class="helptext">{{ form.birthdate.help_text }}</span>
      </div>
      <div class="form-group">{{ form.subscription_type.as_field_group() }}</div>
      <div class="form-group">
        {{ form.payment_method.as_field_group() }}
        <i>
          {% trans trimmed %}
            If the subscription is done using the AE account,
            you must also click it on the AE counter.
          {% endtrans %}
        </i>
      </div>
      <div class="form-group">{{ form.location.as_field_group() }}</div>
    </fieldset>
    <div
      id="subscription-form-user-mini-profile"
      x-html="profileFragment"
      :aria-busy="loading"
    ></div>
  </div>

  <input type="submit" value="{% trans %}Save{% endtrans %}">
</form>
