当用户尝试创建帐户时,我正在Shopify上进行尝试,以验证用户选择的电子邮件是否已经存在,我使用的主题是“首次亮相”。到目前为止,我已经成功实现了0次。
<div class="page-width">
<div class="grid">
<div class="grid__item medium-up--one-half medium-up--push-one-quarter">
<div class="input-form form-vertical">
{% form 'create_customer' %}
<h1 class="text-center">{{ 'customer.register.title' | t }}</h1>
{%- if form.errors -%}
<div class="form-message form-message--error">
{{ form.errors | default_errors }}
</div>
{%- endif -%}
<label for="FirstName">{{ 'customer.register.first_name' | t }}</label>
<input type="text" name="customer[first_name]" id="FirstName" {% if form.first_name %}value="{{ form.first_name }}"{% endif %} autofocus>
<label for="LastName">{{ 'customer.register.last_name' | t }}</label>
<input type="text" name="customer[last_name]" id="LastName" {% if form.last_name %}value="{{ form.last_name }}"{% endif %}>
<label for="Email">{{ 'customer.register.email' | t }}</label>
<input type="email" name="customer[email]" id="Email" class="{% if form.errors contains 'email' %} input--error{% endif %}" {% if form.email %} value="{{ form.email }}"{% endif %} autocorrect="off" autocapitalize="off">
<label for="CreatePassword">{{ 'customer.register.password' | t }}</label>
<input type="password" name="customer[password]" id="CreatePassword" class="{% if form.errors contains 'password' %} input--error{% endif %}">
<label for="CreatePassword2">Repeat Password</label>
<input type="password" name="customer[password]" id="CreatePassword2" class="{% if form.errors contains 'password' %} input--error{% endif %}">
<p class="text-center">
<input type="submit" value="{{ 'customer.register.submit' | t }}" class="btn">
</p>
{% endform %}
</div>
</div>
</div>
</div>
我认为这是
的一部分{{ form.errors | default_errors }}
当电子邮件重复但将不执行任何操作且用户仅被重定向到主页时,将返回错误。关于如何做到这一点的任何想法?谢谢