Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion public/js/app.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/App/assets/js/components/_contact.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ function validateContactUsForm()
event.preventDefault();
$('.contactUsFormErrors').hide();
var submit = true;
if (!$('.g-recaptcha')[0].dataset.sitekey) {
submit = false;
$('#contactUsErrors').show();
$('#recaptchaSiteKeyEmpty').show();
return false;
}
if ($('#contact_form #name').val() == '') {
submit = false;
$('#contactUsErrors').show();
Expand Down
3 changes: 2 additions & 1 deletion src/Contact/templates/contact/contact-form.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@
<p>{% trans 'Any issues or good feedback?' %}<br /><br />{% trans 'Write us here and we will get in touch with you as soon as possible.' %}</p>
<hr />
{{ messagesPartial('partial::alerts') }}
<div id="contactUsErrors" class="alert alert-danger contactUsFormErrors" role="alert" style="display:none">
<div id="contactUsErrors" class="alert alert-danger contactUsFormErrors" role="alert" {% if recaptchaSiteKey != '' %}style="display:none"{% endif %}>
<ul>
<li id="contactUsEmptyName" class="contactUsFormErrors" style="display:none">Name is empty.</li>
<li id="contactUsEmptyEmail" class="contactUsFormErrors" style="display:none">E-mail is empty.</li>
<li id="contactUsEmptyText" class="contactUsFormErrors" style="display:none">Message is empty.</li>
<li id="recaptchaSiteKeyEmpty" class="contactUsFormErrors" {% if recaptchaSiteKey != '' %}style="display:none"{% endif %}>reCAPTCHA is empty.</li>
</ul>
</div>

Expand Down