Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hello
I am new to the dev’s community, thank you for your support
I’m testing the forms for a new theme & I’m having some small problems. Let’s take as ex. the contact form with the fields, contact[name], contact[email], contact[phone], contact[body]
1) To make fields required (name & body) I have added {aria-required="true"}, but when I post a blank form, only email (default) that appears among the errors with the code below. How can I manipulate {form.errors}?
<ul> {% for error in form.errors %} <li> {% if error == 'form' %} {{ form.errors.messages[error] }} {% else %} {{ form.errors.translated_fields[error] }} - {{ form.errors.messages[error] }} {% endif %} </li> {% endfor %} </ul>
2) With the browser inspector, we can delete {aria-required="true"} or the tag id if I manage it in js, how can we check in back-end data to avoid receiving empty messages or saving corrupted data?
3) When submitting a form, the success message will still be displayed even if the page is refresh. Can a single display be made?
Thank you
Hi
Did you find any solution for your problem?
I have the same problem
We recently spoke with Zopi developers @Zopi about how dropshipping businesses can enha...
By JasonH Oct 23, 2024A big shout out to all of the merchants who participated in our AMA with 2H Media: Holi...
By Jacqui Oct 21, 2024We want to take a moment to celebrate the incredible ways you all engage with the Shopi...
By JasonH Oct 15, 2024