<div id="contactUs">
{% if editmode %}
{% do pimcore_head_link().appendStylesheet(asset('static/css/index.css')) %}
{{ pimcore_head_link() }}
{% endif %}
<script src="https://www.google.com/recaptcha/api.js?render={{ google_captcha_v3_site_key }}"></script>
<script>
function getReCaptcha() {
grecaptcha.ready(function() {
document.querySelectorAll('.form--contact').forEach(function(wrapper) {
wrapper.addEventListener("submit", function(event) {
event.preventDefault();
grecaptcha.execute('{{ google_captcha_v3_site_key }}', { action: 'submit' }).then(function(token) {
wrapper.querySelectorAll(".contact-us-g-recaptcha-response").forEach(function(elem, index) {
elem.value = token;
})
});
});
grecaptcha.execute('{{ google_captcha_v3_site_key }}', { action: 'submit' }).then(function(token) {
wrapper.querySelectorAll(".contact-us-g-recaptcha-response").forEach(function(elem, index) {
elem.value = token;
})
});
});
});
}
getReCaptcha();
</script>
{{ form_start(form, { attr: { 'novalidate': 'novalidate', 'class': 'form form--contact'}} ) }}
<div class="form__group form__group--name">
{{ form_widget(form.name, {'attr': { 'class': 'form__input' }}) }}
{{ form_label(form.name, null, {'label_attr': { 'class': 'form__label' }}) }}
<div class="form__error form__error--name" data-error-message="{{ "contact-us.name.max"|trans }}">{{ form_errors(form.name) }}</div>
</div>
<div class="form__group">
{{ form_widget(form.email, {'attr': { 'class': 'form__input' }}) }}
{{ form_label(form.email, null, {'label_attr': { 'class': 'form__label' }}) }}
<div class="form__error form__error--email" data-error-message='["{{ "contact-us.email.required"|trans }}", "{{ "contact-us.email.valid"|trans }}"]'>{{ form_errors(form.email) }}</div>
</div>
<div class="form__group form__group--message">
{{ form_widget(form.message, {'attr': { 'rows': 4, 'class': 'form__textarea' }}) }}
{{ form_label(form.message, null, {'label_attr': { 'class': 'form__label' }}) }}
<div class="form__error form__error--message" data-error-message="{{ "meddox.message.message.blank"|trans }}">{{ form_errors(form.message) }}</div>
</div>
<div class="form__group form__group--inline">
{{ form_label( form.privacyConsent, null, {'label_attr': { 'class': 'form__label' }, 'label_html': true }) | raw }}
{{ form_widget(form.privacyConsent, {'attr': { 'class': 'form__checkbox' }}) }}
<div class="form__error form__error--checkbox" data-error-message="{{ "meddox.contact_us.checkbox.empty"|trans }}">{{ form_errors(form.privacyConsent) }}</div>
</div>
<div class="form__group form__group--inline form__group--invisible d-none">
{{ form_label(form.promotiveMaterialConsent, null, {'label_attr': { 'class': 'form__label' }, 'label_html': true }) | raw }}
{{ form_widget(form.promotiveMaterialConsent, {'attr': { 'class': 'form__checkbox' }}) }}
<div class="form__error form__error--checkbox" data-error-message="{{ "meddox.contact_us.checkbox.empty"|trans }}">{{ form_errors(form.promotiveMaterialConsent) }}</div>
</div>
<input type="hidden" id="contact-us-g-recaptcha-response" class="contact-us-g-recaptcha-response" name="contact-us-g-recaptcha-response">
<div class="form__group form__group--submit">
{{ form_widget(form.submit, {'attr': { 'class': 'btn btn-secondary align-self-end' }}) }}
<div class="form__error">{% if error is defined %}{{ error }}{% endif %}</div>
</div>
{{ form_end(form) }}
</div>