Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I'm trying to make the email field on the contact form required. I was trying to enter the code below but my error is that I didn't tell the aria what to do from what I understand. Does anyone know how I can correct the code?
<div class="grid__item medium-up--one-half">
<label for="ContactFormEmail" class="label--hidden">{{ 'contact.form.email' | t }}</label>
<input type="email" id="ContactFormEmail" name="contact[email]" placeholder="{{ 'contact.form.email' | t }}" autocorrect="off" autocapitalize="off" value="{% if form.email %}{{ form.email }}{% elsif customer %}{{ customer.email }}{% endif %}"
aria-required="true"
{% if form.errors contains 'email'%}
class="input--error"
aria-invalid="true"
aria-describedby="{{ FormId }}-email-error"
{%end if%}
>
</div>
</div>
Hi @PreciousU,
You just need to add 'required' to the input, it will work fine.
Hope it helps!
We want to take a moment to celebrate the incredible ways you all engage with the Shopi...
By JasonH Oct 15, 2024Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024