Making a field required in a form when Aria is used in the script

Hi I have the following script on a page and I need to make the Name field and the Event Date field required. I can’t seem to find a solution because Aria is used in the script and it calls the function for the required field error. Can someone help me with a solution. Also the event date field was working but has now stopped working all together.

Script looks like this:

{{ page.title }}

{% if page.content.size > 0 %}

{{ page.content }}
{% endif %}
{%- assign formId = 'ContactForm' -%} {% form 'contact', id: formId %} {% include 'form-status', form_id: formId %}
{{ 'contact.form.name' | t }}
{{ 'contact.form.email' | t }} * {%- if form.errors contains 'email' -%} {% include 'icon-error' %} {{ form.errors.translated_fields['email'] | capitalize }} {{ form.errors.messages['email'] }}. {%- endif -%}
{{ 'contact.form.phone' | t }}
Event Date
What is your enquiry regarding? {{ 'contact.form.message' | t }} {% if form.body %}{{ form.body }}{% endif %}

{% endform %}

Hi @AboutMo ,

Please change all code:


# {{ page.title }}

{% if page.content.size > 0 %}

{{ page.content }}

{% endif %}

{%- assign formId = 'ContactForm' -%}
{% form 'contact', id: formId %}
{% include 'form-status', form_id: formId %}

{%- if form.errors contains 'email' -%}
{% include 'icon-error' %} {{ form.errors.translated_fields['email'] | capitalize }} {{ form.errors.messages['email'] }}.
{%- endif -%}

{% endform %}

Hope it helps!

Thanks, This seems to be working. One question, how do we make the date field required?

Actually the solution is still not working. I ran a test and the date field is not bringing the data through in the email notification when the form is used. Does this need something fixed elsewhere?

Hi @AboutMo ,

Please send your site and if your site is password protected, please send me the password. I will check it.