Skip to content

Instantly share code, notes, and snippets.

@seandogg
Created October 14, 2019 17:02
Show Gist options
  • Save seandogg/9719528b48fc80b19b96c8355fc8cd16 to your computer and use it in GitHub Desktop.
Save seandogg/9719528b48fc80b19b96c8355fc8cd16 to your computer and use it in GitHub Desktop.
<div class="page-width page-content">
<div class="grid">
<div class="grid__item medium-up--one-third medium-up--push-one-third">
<header class="section-header">
<h1 class="section-header__title">{{ 'customer.register.title' | t }}</h1>
</header>
<div class="form-vertical">
{% form 'style_guide' %}
{{ form.errors | default_errors }}
<label for="FirstName">{{ 'customer.register.first_name' | t }}</label>
<input type="text" name="customer[first_name]" id="FirstName" class="input-full" {% if form.first_name %}value="{{ form.first_name }}"{% endif %} autocapitalize="words" autofocus>
<label for="LastName">{{ 'customer.register.last_name' | t }}</label>
<input type="text" name="customer[last_name]" id="LastName" class="input-full" {% if form.last_name %}value="{{ form.last_name }}"{% endif %} autocapitalize="words">
<label for="Email">{{ 'customer.register.email' | t }}</label>
<input type="email" name="customer[email]" id="Email" class="input-full{% if form.errors contains 'email' %} 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="input-full{% if form.errors contains 'password' %} error{% endif %}">
<p>
<input type="submit" value="{{ 'customer.register.submit' | t }}" class="btn btn--full">
</p>
{% endform %}
</div>
</div>
</div>
</div>
<script>
$(document).ready(function(){
var dontEnter = false;
localStorage.fromRegister = false;
jQuery('#create_customer').submit(function(event) {
console.log('Submitted')
if(dontEnter == false){
event.preventDefault();
localStorage.fromRegister = true;
dontEnter = true;
jQuery('#create_customer').submit();
}
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment