Email Validation For Custom Form Always Throws Invalid

Highlighted
Shopify Partner
44 3 7

I'm sure it's something simple as I had it working when there was only one email on the form. But now I have several emails it always throws an error.

Any pointers would be mucho appreciated.


https://www.selectlok.com/pages/account-application

0 Likes
Highlighted
Shopify Partner
44 3 7

Through some trial and error it would appear that maybe because I'm creating a 'contact' form, I need one of the emails to be  id="{{ formId }}-email". I don't know if this is true or not so it'd be fantastic if someone could confirm this. But I have added another email entry that has this id and it submits properly.

1 Like
Highlighted
Excursionist
13 1 0

Hi,

Hope you are fine!

maybe you must use form conatct:

 

{% form 'contact' %}

{% if form.posted_successfully? %}
<p class="note form-success">
{{ 'contact.form.post_success' | t }}
</p>
{% endif %}

{% include 'form-errors-custom' %}

<div id="contactFormWrapper">
<di>
<div style='text-align:center;'>
<h3 class="doc-title">Text</h3>

<h3 class="doc-title">Text.</h3>

</div>

<h4 class="docs-title">Text.</h4>

<div class="grid__item medium-up--one-half small--one-whole">
<label for="ContactFormname">Name.</label>
<input type="text" id="ContactFormName" style="width: 100%" name="contact[Name]" placeholder="..."/>
</div>

<div class="grid__item medium-up--one-half small--one-whole">
<label for="ContactformFirstName">Fiirst Name.</label>
<input type="text" id="ContactFormFirstName" style="width: 100%" name="contact[FirstName]" placeholder="..."/>
</div>

<div class="grid__item medium-up--one-half small--one-whole">
<label for="ContactformXXX">XXX.</label>
<input type="text" id="ContactFormXXX" style="width: 100%" name="contact[XXX]" placeholder="..."/>
</div>

<hr>

<div style='text-align:center;'>
<h3 class="doc-title">Text.</h3>
</div>

<div class="grid__item medium-up--one-half small--one-whole">
<label for="ContactFormName2">Name2.</label>
<input type="text" id="ContactFormName2" style="width: 100%" name="contact[Name2]" placeholder="..."/>
</div>


<div class="grid__item medium-up--one-half small--one-whole">
<label for="ContactformFirstName2">First Name 2.</label>
<input type="text" id="ContactFormFirstName2" style="width: 100%" name="contact[First Name 2]" placeholder="..."/>
</div>


<div class="grid__item medium-up--one-half small--one-whole">
<label for="ContactformXXX2">XXX2.</label>
<input type="text" id="ContactFormXXX2" style="width: 100%" name="contact[XXX 2]" placeholder="..."/>
</div>

<div class="grid__item medium-up--one-half small--one-whole">
<label for="ContactformName3">Name 3.</label>
<input type="text" id="ContactFormName3" style="width: 100%" name="contact[Name 3]" placeholder="..."/>
</div>


<div class="grid__item medium-up--one-half small--one-whole">
<label for="ContactformPhone">Phone.</label>
<input type="tel" id="ContactFormPhone" style="width: 100%" name="contact[Phone]" placeholder="..."/>
</div>

Email.
<label for="contactFormEmail" class="hidden-label">{{ '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 %}">

Email 2.
<label for="contactFormEmail2" class="hidden-label">{{ 'contact.form.email' | t }}</label>
<input type="email" id="contactFormEmail2" name="contact[email 2]" placeholder="{{ 'contact.form.email' | t }}" autocorrect="off" autocapitalize="off" value="{% if form.email %}{{ form.email }}{% elsif customer %}{{ customer.email }}{% endif %}">

<div class="grid__item medium-up--one-half small--one-whole">
<label for="ContactformMessage">jhdjhjkdhsjdh</label>
<textarea rows="10" id="contactFormMessage" name="contact[regergergerg]" placeholder="...">
</textarea>
</div>

<p></p>

<p>

<p>

<button><input type="submit" class="btn right" value="{{ 'Valider' | }}"></button>

</p>

{% endform %}

 

@MT-Sentissi
- Click Like to let me know, if my Reply was helpful!
- "Accept as Solution" if my comments were a help to your question!
0 Likes